On 9/4/07, Thomas Heller <[EMAIL PROTECTED]> wrote:

> Shouldn't the __getattr__ implementation find the __iter__ method
> of the _stream instance variable?


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.

This change is really the biggest difference between classic classes and
new-style classes, much bigger than the MRO change ;-)

-- 
Thomas Wouters <[EMAIL PROTECTED]>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to