Define and call static method in a class : Static Method : Language Basics PYTHON examples


PYTHON examples » Language Basics » Static Method »

 

Define and call static method in a class


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 Scripts with Example Source Code in same category :

Leave a Comment / Note


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


PYTHON examples

 Navioo Language Basics
» Static Method