[Python-3000] PEP for Metaclasses in Python 3000

Georg Brandl g.brandl at gmx.net
Sun Mar 11 09:06:47 CET 2007


Greg Ewing schrieb:
> Some more metaclass syntax ideas:
> 
>    class Foo[Meta](bases):
>      ...
> 
>    Meta class Foo(bases):
>      ...
> 
> although I don't like the way the latter moves the
> 'class' keyword away from the beginning.

You could even unify metaclass and class decorator, if you alter
the latter's definition; give it not a "class" argument, but
"type", "name", "bases" and "dict" and have it return the same,
but possibly altered or different objects. :D

Georg



More information about the Python-3000 mailing list