Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32504

Re: calling one staticmethod from another

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: calling one staticmethod from another
Date 2012-10-30 21:29 +0000
References <tit4m9-1ei.ln1@satorlaser.homedns.org>
Newsgroups comp.lang.python
Message-ID <mailman.3103.1351632558.27098.python-list@python.org> (permalink)

Show all headers | View raw


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.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

calling one staticmethod from another Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-10-30 13:25 +0100
  Re: calling one staticmethod from another Ethan Furman <ethan@stoneleaf.us> - 2012-10-30 06:41 -0700
  Re: calling one staticmethod from another Dave Angel <d@davea.name> - 2012-10-30 09:47 -0400
    Re: calling one staticmethod from another Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-10-30 16:39 +0100
  Re: calling one staticmethod from another Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-30 09:27 -0600
  Re: calling one staticmethod from another Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-30 21:29 +0000

csiph-web