Define and call static method in a class : Static Method « Language Basics « Python
- Python
- Language Basics
- Static Method
Define and call static method in a class

class AClass(object):
def astatic():
print 'a static method'
astatic = staticmethod(astatic)
anInstance = AClass()
AClass.astatic()
anInstance.astatic()
Related examples in the same category