"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >>> class Parrot: > ... def speak(): > ... return "dead parrot" > ... speak = staticmethod(speak) > ... def playdead(): > ... return "still dead" > ... > >>> type(Parrot.speak) > <type 'function'> > >>> type(Parrot.playdead) > <type 'instancemethod'> > > So, based on this evidence, staticmethod() converts an > instance method into an ordinary function. Parrot.speak > certainly behaves like an ordinary function.
Actually, staticmethod() prevents an ordinary function from being converted to (wrapped as) a method upon access via the class. >>> class C(object): def f(s): pass >>> type(C.__dict__['f']) <type 'function'> >>> type(C.f) <type 'instancemethod'> As to the general topic: my impression is that staticmethod was a rather optional addon with limited usage and that beginners hardly need to know about it. Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list