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


Groups > comp.lang.python > #20387 > unrolled thread

Re: how to tell a method is classmethod or static method or instance method

Started byZheng Li <dllizheng@gmail.com>
First post2012-02-14 13:13 +0900
Last post2012-02-14 13:13 +0900
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: how to tell a method is classmethod or static method or instance method Zheng Li <dllizheng@gmail.com> - 2012-02-14 13:13 +0900

#20387 — Re: how to tell a method is classmethod or static method or instance method

FromZheng Li <dllizheng@gmail.com>
Date2012-02-14 13:13 +0900
SubjectRe: how to tell a method is classmethod or static method or instance method
Message-ID<mailman.5791.1329192844.27778.python-list@python.org>
I can get "method1" of class "Test" by
a = getattr(Test, "method1")

and I also want know how to invoke it
a()	or	a(Test())



BTW:
I don't see what the problem is if I ask a question just because I am curious about it.


On 2012/02/13, at 16:23, Cameron Simpson wrote:

> On 13Feb2012 15:59, Zheng Li <dllizheng@gmail.com> wrote:
> | how to tell a method is class method or static method or instance method?
> 
> Maybe a better question is:
>  under what circumstances do you need to figure this out? 
> 
> I'm actually quite serious here. Please outline what circumstances cause
> you to want to ask and answer this question.
> 
> Cheers,
> -- 
> Cameron Simpson <cs@zip.com.au> DoD#743
> http://www.cskk.ezoshosting.com/cs/
> 
> Reason #173 to fear technology:
> 
>    o       o       o       o       o       o      <o      <o>
>   ^|\     ^|^     v|^     v|v     |/v     |X|      \|      |
>    /\      >\     /<       >\     /<       >\     /<       >\
> 
>    o>      o       o       o       o       o       o       o
>    \       x      </      <|>     </>     <\>     <)>      |\
>   /<       >\     /<       >\     /<       >\      >>      L
> 
>             Mr. email does the Macarena.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web