[Python-3000] PEP for Metaclasses in Python 3000

Phillip J. Eby pje at telecommunity.com
Tue Mar 13 22:37:39 CET 2007


At 02:26 PM 3/13/2007 -0700, Josiah Carlson wrote:
>But in slightly longer examples, I think that the looks are
>significantly improved...
>
>     class Foo(base1, base2, *otherbases, metaclass=mymeta,
>         private=True, **kwargs):
>         ...
>
>vs.
>
>     @@(metaclass=mymeta, private=True, **kwargs)
>     class Foo(base1, base2, *otherbases):
>         ...

I was confused for a minute, because I thought you were contradicting 
yourself, because it was so obvious that the *first* one looks better.

It took me a while to realize you're saying you like the bottom one better, 
whereas to me it's like "ugh".  If it was a choice between using that 
syntax and not having the feature, I'd frankly choose not having the 
feature, as I'm making do right now with magic functions in the class body 
to do this sort of thing.  They look a heckuva lot better than the @@ thing.

Fortunately, I think Guido has all but Pronounced on the first syntax, and 
IMO with good reason.  The symmetry with normal function syntax is just too 
good to pass up.



More information about the Python-3000 mailing list