thanks. It is working for simple classes. But now i am trying for complex objects. <div><br></div><div>myclassinstance.__class__.dict__ returns <dictproxy object at %$^%> </div><div><br></div><div>Looping through the same returned dictproxy gives attributes of superclass. What am i doing wrong?</div>
<div><br><br><div class="gmail_quote">On Fri, Mar 12, 2010 at 12:15 AM, Gabriel Genellina <span dir="ltr"><<a href="mailto:gagsl-py2@yahoo.com.ar">gagsl-py2@yahoo.com.ar</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
En Thu, 11 Mar 2010 01:47:30 -0300, Radhakrishna Bhat<br>
<<a href="mailto:radhakrishna12@gmail.com" target="_blank">radhakrishna12@gmail.com</a>> escribió:<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am using getattr to get a method instance from a class. But it also<br>
returns methods from the superclass. How to detect if an attribute is from<br>
superclass?<br>
</blockquote>
<br></div>
You may look it up directly in the class dictionary (__dict__)<br>
<br>
-- <br>
Gabriel Genellina<br><font color="#888888">
<br>
-- <br></font><div><div></div><div class="h5">
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br></div>