calling one staticmethod from another

Ulrich Eckhardt ulrich.eckhardt at dominolaser.com
Tue Oct 30 08:25:33 EDT 2012


Hi!

I can call a staticmethod f() of class C like "C.f()" or with an 
instance like "C().f()". Inside that staticmethod, I have neither the 
class (at least not the original one) nor do I have an instance, so I 
can't call a different staticmethod from the same class. The obvious 
solution is to make this a classmethod instead, with a mostly-unused 
"cls" parameter.

Am I missing something?

Uli



More information about the Python-list mailing list