[Python-3000] Metaclasses in Py3K

Phillip J. Eby pje at telecommunity.com
Sat Dec 16 21:23:54 CET 2006

At 11:30 AM 12/16/2006 -0800, Talin wrote:
>The general idea is to have the metaclass create a mapping object which
>is used as the 'locals' dictionary for the suite following the class
>statement. There would be some special-named function of the metaclass,
>such as '__metadict__', which would construct a new mapping object. I
>haven't seen many alternative proposals to this.

There's mine, where you simply create mcls(name, bases, {}) and then map 
locals operations to get/set/delattr operations on the class.  This would 
presumably be done using a simple mapping proxy, but it would be a built-in 
type rather than the user having to implement their own mapping type.

More information about the Python-3000 mailing list