Mike Orr a écrit :
(snip)
'self' has a .__class__ attribute because it's an
instance, but MyClass and Superclass do not because they're already
classes.
Not true for new-style classes:
>>> class Toto(object): pass
...
>>> Toto.__class__
<type 'type'>
(snip)
I sometimes wish classes
had a .__class__ attribute that's the class itself,
newstyle classes do have a class attribute, that refers to the metaclass.
but I can see how
that would cause its own confusion (and recursion).
FWIW, metaclasses do have a class attribute that refers to itself !-)
--
http://mail.python.org/mailman/listinfo/python-list