[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: Get a method instance through 'getattr' but not superclass's method

Gabriel Genellina

3/11/2010 6:45:00 PM

En Thu, 11 Mar 2010 01:47:30 -0300, Radhakrishna Bhat
<radhakrishna12@gmail.com> escribió:

> I am using getattr to get a method instance from a class. But it also
> returns methods from the superclass. How to detect if an attribute is
> from
> superclass?

You may look it up directly in the class dictionary (__dict__)

--
Gabriel Genellina