[Python-3000] PEP for Metaclasses in Python 3000 (original) (raw)

Georg Brandl g.brandl at gmx.net
Sat Mar 10 10:30:31 CET 2007


Jack Diederich schrieb:

I am a very big fan of ordered dicts in classes. One possibility is that suites in classes always store their order in a special dict that keeps a side list of key order. A final invisible class decorator around every class would then toss out the order and leave only a regular dict.

So perhaps, thanks to metaclasses, all those people wanting ordered dicts in Python's core finally get their wish. ;)

Seriously, I'm not very convinced of the "metaclass-as-keyword-args" syntax. It appears too arbitrary.

Then again, setting something (metaclass) in the class which affects the creation of the class is not very idiomatic either.

"class Foo as A" is altogether confusing, since all usages of "as" so far at least assigned something to "A".

cheers, Georg



More information about the Python-3000 mailing list