christian heimes wluhecheimesde nick coghlan wrote interpreter actually permitted bypass instance looking magic methods whether implementation dependent even cpython varies behaviour depending specific circumstance eg translation statements bytecode ends using normal get_attr opcodes see __enter__ __exit__ methods instances magic method lookups c code bypass instance go straight relevant tp_ slot suspected different behavior related c type slots well tp_iter part pytypeobject struct __enter__ __exit__ methods ordinary methods wasnt sure behavior correct ive never encountered problem dark corners language far testing iter doesnt even go __getattribute__ grabs class lookup class class exampleobject def __getattribute__self name print name return object__getattribute__self name e example itere __class__ traceback recent call last file line 1 typeerror example object iterable thats either bug least big gotcha developers proxy objects least expected __getattribute__ called every attribute including magic methods documented somewhere docs say see meth__getattribute__ method way actually get total control attribute access christian _______________________________________________ python3000 mailing list smsbmo9552pythonorg httpmailpythonorgmailmanlistinfopython3000 unsubscribe httpmailpythonorgmailmanoptionspython3000python300040tangomucom wed 06 aug 2008 012726 0100 python3000 code freeze