Get a method instance through 'getattr' but not superclass's method
Radhakrishna Bhat
radhakrishna12 at gmail.com
Sat Apr 3 12:37:45 EDT 2010
thanks. It is working for simple classes. But now i am trying for complex
objects.
myclassinstance.__class__.dict__ returns <dictproxy object at %$^%>
Looping through the same returned dictproxy gives attributes of superclass.
What am i doing wrong?
On Fri, Mar 12, 2010 at 12:15 AM, Gabriel Genellina
<gagsl-py2 at yahoo.com.ar>wrote:
> En Thu, 11 Mar 2010 01:47:30 -0300, Radhakrishna Bhat
> <radhakrishna12 at 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
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100403/e810ed1a/attachment.html>
More information about the Python-list
mailing list