identifying new not inherited methods

Chaz Ginger cginboston at hotmail.com
Tue Sep 26 14:58:42 EDT 2006


Steve Holden wrote:
> Chaz Ginger wrote:
>> Steve Holden wrote:
>>
>>> malkarouri at gmail.com wrote:
>>>
>>>> Hi,
>>>>
>>>> I am writing a library in which I need to find the names of methods
>>>> which are implemented in a class, rather than inherited from another
>>>> class. [...]
>>
>>
>> You don't really want to use dir(A), since this will not pick up all 
>> the   classes that make up A.  Don't you want to use the MRO instead?
>>
> Tell me, what won't appear in the dir() of A that *will* appear in the 
> dir() of a subclass of A? Seems to me you're trying to overcomplicate 
> things.
> 
> regards
>  Steve
You are right...I just never did a dir(class) before, instead relying on 
using the MRO to do the searching. dir(class) is certainly a lot 
simpler! Thanks.




More information about the Python-list mailing list