Tuesday, April 19, 2011

python staticmethod declare

>>> class C:
...     @staticmethod
...     def hello():
...             print "Hello World"
...
>>> C.hello()
Hello World
 
source:
http://effbot.org/pyfaq/tutor-how-do-i-make-public-and-private-attributes-and-methods-in-my-classes.htm 

No comments: