[Python-Dev] RE: Hot-To Guide for Descriptors - Nits! :-)

Guido van Rossum guido at python.org
Wed Jan 21 15:48:35 EST 2004


> I'm with Raymond.  Metaclasses that don't derive from 'type' can
> create objects that are neither fish nor flesh.

After thinking this through some more, I have to retract that.  After
all, even classic classes and their instances are derive from object:

>>> class C: pass

>>> isinstance(C, object)
True
>>>
>>> isinstance(C(), object)
True

What makes a classic class is one very specific metaclass.  What makes
a classic instance is a class using that very specific metaclass.
Everything else is a new-style class.

Perhaps an exception should be made for Zope's ExtensionClasses, which
are not classic classes but old-style "extension types", but they will
disappear in the future and there's really nothing else like them.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list