<br><br><div><span class="gmail_quote">On 9/4/07, <b class="gmail_sendername">Thomas Heller</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Shouldn't the __getattr__ implementation find the __iter__ method<br>of the _stream instance variable?</blockquote><div><br>No. For new-style classes, the special methods (that are part of the PyType C struct) are always looked up on the class, never the instance. The class's __getattr__ is never called. It's the class that defines behaviour, and __getattr__ and __getattribute__ just define how to handle *instance* attribute access.
<br><br>This change is really the biggest difference between classic classes and new-style classes, much bigger than the MRO change ;-)<br></div></div><br>-- <br>Thomas Wouters <<a href="mailto:firstname.lastname@example.org">email@example.com
</a>><br><br>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!