Re: calling one staticmethod from another

2012-10-31 Thread Ulrich Eckhardt
Am 30.10.2012 18:23, schrieb Jean-Michel Pichavant: - Original Message - [snip] I haven't figured out the justification for staticmethod, http://en.wikipedia.org/wiki/Namespace + "Namespaces are one honking great idea -- let's do more of those!" Someone may successfully use only modul

Re: calling one staticmethod from another

2012-10-30 Thread Mark Lawrence
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 th

Re: calling one staticmethod from another

2012-10-30 Thread Jean-Michel Pichavant
- Original Message - [snip] > I haven't figured out the justification for staticmethod, http://en.wikipedia.org/wiki/Namespace + "Namespaces are one honking great idea -- let's do more of those!" Someone may successfully use only modules as namespaces, but classes can be used as well.

Re: calling one staticmethod from another

2012-10-30 Thread Ulrich Eckhardt
Am 30.10.2012 14:47, schrieb Dave Angel: I'd think the obvious solution is to move both the functions outside of the class. I haven't figured out the justification for staticmethod, except for java or C++ converts. Although I come from a C++ background, I think static functions have solid rea

Re: calling one staticmethod from another

2012-10-30 Thread Ian Kelly
On Tue, Oct 30, 2012 at 7:41 AM, Ethan Furman wrote: > class Spam(): > @staticmethod > def green(): > print('on a train!') > @staticmethod > def question(): > print('would you, could you', end='') > Spam.green() > > It can be a pain if you change the class n

Re: calling one staticmethod from another

2012-10-30 Thread Dave Angel
On 10/30/2012 08:25 AM, 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 staticme

Re: calling one staticmethod from another

2012-10-30 Thread Ethan Furman
Ulrich Eckhardt wrote: 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 obviou