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

Phillip J. Eby pje at telecommunity.com
Tue Mar 13 17:06:55 CET 2007


At 10:33 PM 3/13/2007 +1000, Nick Coghlan wrote:

Greg Ewing wrote: > If they're passed to both, then the signatures become > > metaclass.prepare(name, bases, **kwargs) > metaclass(name, bases, body, **kwargs) > > BTW, I don't think I like the name "prepare" much > more than "metacreate". It seems just as wooly. > What's being prepared? How? What for?

namespace and instancedict are the most literally descriptive names that have occurred to me (after all, the role of the method is to return the locals() dictionary for the creation of a class). That said, new & init could also be said to be somewhat woolly if you didn't already know what they did - preparing a namespace for evaluation of a class body shouldn't be hard to remember once someone has learned what the term is referring to. If Guido decides he likes prepare, I can certainly live with it :) (I actually quite like the connotation that what the method returns has been prepared for something, but isn't really finished yet)

How about class_locals()? This would at least say exactly what the return value is used for.



More information about the Python-3000 mailing list