calling one staticmethod from another

Mark Lawrence breamoreboy at yahoo.co.uk
Tue Oct 30 17:29:28 EDT 2012


On 30/10/2012 12:25, Ulrich Eckhardt wrote:
> 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

I hope that you find these useful.

http://dirtsimple.org/2004/12/python-is-not-java.html
http://dirtsimple.org/2004/12/java-is-not-python-either.html

-- 
Cheers.

Mark Lawrence.




More information about the Python-list mailing list