Metaclasses broke in 2.2?

Drew Csillag drew_csillag at
Tue Aug 14 16:56:19 CEST 2001

On Tue, Aug 14, 2001 at 03:41:31AM +0000, Guido van Rossum wrote:
> Drew Csillag <drew_csillag at> writes:
> > I don't know if this was intended, but it appears that the metaclass
> > instantiation doesn't work with Python 2.2a1.  Are the old metaclass
> > things no longer supported in 2.2 or is it just temporarily broken?
> Can you be more specific?  What old metaclass are you referring to?
> It's probably broken because I changed the Don Beaudry hook invocation
> to favor the new metaclass mechanism that is central to the new types
> in 2.2.

Take any of the code in Demo/metaclasses in 2.2a1.  You get tracebacks
of the variety:

Traceback (most recent call last):
  File "", line 113, in ?
  File "", line 101, in _test
    class C(Eiffel):
TypeError: cannot create 'instance' instances
Traceback (most recent call last):
  File "", line 169, in ?
  File "", line 128, in _test
    class Color(Enum):
TypeError: cannot create 'instance' instances

I guess the real question is: "how does one go about writing metaclasses
in Python code in 2.2?"



More information about the Python-list mailing list