Anonymous user
Call an object method: Difference between revisions
→{{header|Tcl}}: Add Python.
m (→{{header|J}}) |
(→{{header|Tcl}}: Add Python.) |
||
Line 53:
This last case can be useful when debugging.
=={{header|Python}}==
<lang python>>>> class MyClass():
def myMethod(self):
return 42
>>> myInstance = MyClass()
>>> # Call static method on a separate instance
>>> MyClass.myMethod(myInstance)
42
>>> # Call instance method implicitely on its instance
>>> myInstance.myMethod()
42
>>> </lang>
=={{header|Tcl}}==
|