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


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0