[Python-3000] Metaclasses in Py3K (original) (raw)
Phillip J. Eby pje at telecommunity.com
Sat Dec 16 21:23:54 CET 2006
- Previous message: [Python-3000] Metaclasses in Py3K
- Next message: [Python-3000] Metaclasses in Py3K
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message: [Python-3000] Metaclasses in Py3K
- Next message: [Python-3000] Metaclasses in Py3K
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]