Re: Metaclass of a metaclass

2012-06-05 Thread bruno.desthuilli...@gmail.com
On Jun 5, 10:48 am, Steven D'Aprano wrote: > Apparently it gives an error. Can anyone explain why this does not work? > > # Python 3.2 > > >>> class MyType(type):  # A metaclass... > > ...     def __repr__(self): > ...             s = super().__repr__() > ...             return s.replace('class',

Re: Metaclass of a metaclass

2012-06-05 Thread Ian Kelly
On Tue, Jun 5, 2012 at 2:48 AM, Steven D'Aprano wrote: > I was playing around with metaclasses and I wondered what would happen if > the metaclass itself had a metaclass. Sort of a metametaclass. > > Apparently it gives an error. Can anyone explain why this does not work? In your example, Meta is

Re: Metaclass of a metaclass

2012-06-05 Thread Peter Otten
Steven D'Aprano wrote: > I was playing around with metaclasses and I wondered what would happen if > the metaclass itself had a metaclass. Sort of a metametaclass. > > Apparently it gives an error. Can anyone explain why this does not work? > > # Python 3.2 > > > class MyType(type): # A

Metaclass of a metaclass

2012-06-05 Thread Steven D'Aprano
I was playing around with metaclasses and I wondered what would happen if the metaclass itself had a metaclass. Sort of a metametaclass. Apparently it gives an error. Can anyone explain why this does not work? # Python 3.2 >>> class MyType(type): # A metaclass... ... def __repr__(self):