469,133 Members | 1,269 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,133 developers. It's quick & easy.

Determine if object is a Bound or Unbound method

Hi,

I have an object and I want to check if it is a bound or unbound method,
or neither. I tried using the types module, but it seems as though
types.UnboundMethodType and types.MethodType are equal. How else can I
determine this? BTW, I'm using Python 2.3

Thanks,

Farshid
Jul 28 '05 #1
2 1760
Farshid Lashkari wrote:
Hi,

I have an object and I want to check if it is a bound or unbound method,
or neither. I tried using the types module, but it seems as though
types.UnboundMethodType and types.MethodType are equal. How else can I
determine this? BTW, I'm using Python 2.3

Thanks,

Farshid

Bound methods has an im_self attribute set to the instance binding them

Ciao
___________________________________
Yahoo! Messenger: chiamate gratuite in tutto il mondo
http://it.beta.messenger.yahoo.com
Jul 28 '05 #2
Grazie!

Paolino wrote:
Farshid Lashkari wrote:
Hi,

I have an object and I want to check if it is a bound or unbound
method, or neither. I tried using the types module, but it seems as
though types.UnboundMethodType and types.MethodType are equal. How
else can I determine this? BTW, I'm using Python 2.3

Thanks,

Farshid


Bound methods has an im_self attribute set to the instance binding them

Ciao
___________________________________ Yahoo! Messenger: chiamate gratuite
in tutto il mondo http://it.beta.messenger.yahoo.com

Jul 28 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Lenard Lindstrom | last post: by
7 posts views Thread by Edward Diener | last post: by
6 posts views Thread by Ivan Voras | last post: by
16 posts views Thread by Fuzzyman | last post: by
7 posts views Thread by simonwittber | last post: by
275 posts views Thread by Astley Le Jasper | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.