[Tutor] what is @classmethod and @staticmethod ??

Kent Johnson kent37 at tds.net
Mon Mar 24 01:56:36 CET 2008


Tony Cappellini wrote:
>>  I don't use classmethods so I can't discuss that. For staticmethods,
>>  suppose I have in foo.py
> 
> Where is the word "staticmethod" in the example below? Where is it used?
> This is what I was hoping to see.

It would be

class Foo(object):
   @staticmethod
   def doSomethingRelatedToFoo():
     # whatever

Kent


More information about the Tutor mailing list