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

Josiah Carlson jcarlson at uci.edu
Sat Mar 10 23:00:31 CET 2007


"Phillip J. Eby" <pje at telecommunity.com> wrote:

At 12:40 PM 3/10/2007 -0800, Josiah Carlson wrote:

>Talin <talin at acm.org> wrote: > > I strongly feel that this makes using metaclasses way too complex. A > > person wanting to create a C struct or a database record should simply > > have to say "metaclass=cstruct" - they shouldn't have to declare a bunch > > of individual pieces, all of which have to match with each other. > > There's no utility in being able to "mix n' match" metaclasses and dicts. > > > > In any case, we're just going over old ground here. > >Great! If there is no need to mix and match metaclasses and dicts >arbitrarily, then there is no need to pass alternate parameters to the >dictionary construction method, Er, wha? Those two things are utterly unrelated.

I did have a post that was going to show that they were related, but then I remembered that because of metaclass assignment semantics, it needs to necessarily have access to the class body dictionary at the point of assignment, so the compiler, etc., cannot be taught to extract everything. Syntax is necessary to offer an ordered dictionary semantics.

I guess I'll toss my hat in for +0 on...

class foo(..., metaclass=..., arbitrary_keyword=i_suppose):
    ...


More information about the Python-3000 mailing list