package.subpackage.object

Classes

Object(arg1[, arg2, arg3])

This method, like all those whose names begin and end with "__" are special.

class package.subpackage.object.Object(arg1, arg2=None, arg3='string')

Bases: Base

This method, like all those whose names begin and end with “__” are special. You won’t ever need to call these methods directly, but Python will invoke them for you under certain circumstances, which are described in the Python Reference Manual: Special Method Names.

As an example, the __init__() method is invoked when you create an object, as in:

obj = Object(arg1=something, arg3=somethingElse, ...)
Parameters:
  • arg1

    this argument is required. Python supports named arguments, so you must either list the value for arg1 first:

    obj = Object(val1, val2)
    

    or you can specify the arguments in any order, as long as they are named:

    obj = Object(arg2=val2, arg1=val1)
    

  • arg2 – this argument may be omitted, in which case it will be assigned a default value of None. If you do not use named arguments (and we recommend that you do), all required arguments must be specified before any optional arguments.

  • arg3 – this argument may be omitted, in which case it will be assigned a default value of 'string'.

method1()

This is one thing that you can instruct any object that derives from Base to do, by calling myObjectDerivedFromBase.method1()

Parameters:

self (object) –

This special argument refers to the object that is being created.

Attention

self is supplied automatically by the Python interpreter to all methods. You don’t need to (and should not) specify it yourself.

method2()

Object provides a new definition for the behavior of method2(), whereas the behavior of method1() is defined by Base.

Last updated on Jun 26, 2024. Created using Sphinx 7.1.2.