to be passed in when invoked to designate such methodsclasses call the built-in functions staticmethod and classmethodas hinted in the earlier discussion of new-style classes both mark function object as special--that isas requiring no instance if static and requiring class argument if class method for examplein the file bothmethods py (which unifies and printing with liststhough displays still vary slightly for classic classes)file bothmethods py class methodsdef imeth(selfx)print([selfx]normal instance methodpassed self def smeth( )print([ ]staticno instance passed def cmeth(clsx)print([clsx]classgets classnot instance smeth staticmethod(smethcmeth classmethod(cmethmake smeth static method (or @aheadmake cmeth class method (or @aheadnotice how the last two assignments in this code simply reassign ( rebindthe method names smeth and cmeth attributes are created and changed by any assignment in class statementso these final assignments simply overwrite the assignments made earlier by the defs as we'll see in few momentsthe special syntax works here as an alternative to this just as it does for properties--but makes little sense unless you first understand the assignment form here that it automates technicallypython now supports three kinds of class-related methodswith differing argument protocolsinstance methodspassed self instance object (the defaultstatic methodspassed no extra object (via staticmethodclass methodspassed class object (via classmethodand inherent in metaclassesmoreoverpython extends this model by also allowing simple functions in class to serve the role of static methods without extra protocolwhen called through class object only despite its namethe bothmethods py module illustrates all three method typesso let' expand on these in turn instance methods are the normal and default case that we've seen in this book an instance method must always be called with an instance object when you call it through an instancepython passes the instance to the first (leftmostargument automaticallywhen you call it through classyou must pass along the instance manuallyfrom bothmethods import methods normal instance methods obj methods(callable through instance or class obj imeth( [ static and class methods