Static Methods and Class Methods : Static : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Static »

 

Static Methods and Class Methods


class MyClass:
    @staticmethod
    def smeth():
        print 'This is a static method'

    @classmethod
    def cmeth(cls):
        print 'This is a class method of', cls

MyClass.smeth()
MyClass.cmeth()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Class
» Static