There are two different ways to call a method
of
some class M:
C
Most calls are bound method calls of this form, where is an instance of some
class I:
C
I.methodName(a1,a2, ...)
The instance replaces Iself as the
first argument when setting up the arguments to be
passed to the method.
The following form, called an unbound method call, is exactly equivalent to the above:
C.methodName(i,a1,a2, ...)
Here is a demonstration of the equivalence of bound and unbound method calls.
>>> class C:
... def __init__(self, x):
... self.x = x
... def show(self, y):
... print "*** ({0},{1}) ***".format(self.x, y)
...
>>> c=C(42)
>>> c.show(58)
*** (42,58) ***
>>> C.show(c,58)
*** (42,58) ***