Know if a object member is a method

Tino Wildenhain tino at wildenhain.de
Mon Sep 1 08:17:44 EDT 2008


Luca wrote:
> On Mon, Sep 1, 2008 at 11:35 AM, Steven D'Aprano
> <steven at remove.this.cybersource.com.au> wrote:
...
>> But not so easy to fool a type check:
>>
>>>>> type(x) == new.function
>> False
>>
>> Of course that's not bullet-proof either. I leave it as an exercise to
>> discover how you might break that piece of code.
>>
> 
> Ok, so...
> 
> What is the best way to do this? The "most pythonic"?

The question would be - why do you want this? Is it just
curiosity or can we find a better solution to the overall
problem, once understood?

Regards
Tino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3241 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20080901/bc603d21/attachment-0001.bin>


More information about the Python-list mailing list