On Feb 18, 1:24 pm, "Fuzzyman" <[EMAIL PROTECTED]> wrote: > Why is the __name__ attribute not available to the instance? Why don't > normal lookup rules apply (meaning that a magic attribute will be > looked up on the class for instances) ?
Because __name__ isn't really an attribute, it is a descriptor defined on the metaclass: >>> type(type.__dict__['__name__']) <type 'getset_descriptor'> See http://users.rcn.com/python/download/Descriptor.htm for a guide to descriptors, and the papers by me and David Mertz for a guide to metaclasses. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list