[Tutor] Class vs. instance

Stayvoid stayvoid at gmail.com
Sun Jan 1 20:40:13 CET 2012


Hi there!

>>> class Sample:
>>>     def method(self): pass

>>> Sample().method()

What's the difference between class __main__.Sample and
__main__.Sample instance?
Why should I write "Sample().method" instead of "Sample.method"?


Cheers!


More information about the Tutor mailing list