[Python-3000] Metaclasses in Python 3000: Draft 2

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 15 00:13:45 CET 2007


Phillip J. Eby wrote:

> So the subset required is determined entirely by what the class body 
> (and metaclass __new__) require.

Perhaps the PEP should say something to the effect that
get, set and delete need to be implemented in order to
support all the things the class body might want to do,
but a metaclass can omit them if it wants to restrict
what can be done in the class body.

> So the metaclass' __new__ 
> is going to need to read out the contents of the pseudo-dict somehow, or 
> generate alternative contents.

Maybe the PEP should specify a protocol that the
pseudo-dict must provide for doing this, such as an
iteritems() method (or whatever the Py3k equivalent
is).

--
Greg



More information about the Python-3000 mailing list