 |
 |
 |
 |
 |
 |
 |
>>> class AClass:
|
|
|
... def amethod(self):
|
|
|
... print ‘Hi’, self
|
|
|
...
|
|
|
...
|
|
|
>>> a
|
|
|
<__main__.A instance at 0x00A9B350>
|
|
|
>>> a.amethod()
# implicit self
|
|
|
Hi <__main__.A instance at 0x00A9B350>
|
|
>>> Aclass.amethod(a) # explicit self
|
|
|
Hi <__main__.A instance at 0x00A9B350>
|