[Python-Dev] Adding types.build_class for 3.3 (original) (raw)

Mark Shannon mark at hotpy.org
Fri May 11 08:21:36 CEST 2012


Nick Coghlan wrote:

On Fri, May 11, 2012 at 3:31 AM, Barry Warsaw <barry at python.org> wrote:

On May 09, 2012, at 07:44 PM, R. David Murray wrote:

(*) Actually, come to think of it, I probably refer to it as "constructing" the class, rather than creating or defining it. It's the type equivalent of constructing an instance, perhaps? If, as Nick proposes in a different message, it actually does make better sense to put this as a module-level function, then putting class in the name makes sense. types.{new,create,build,construct}class() works for me, in roughly that order. Yeah, as a result of the discussion in this thread, and considering the parallel with "imp.newmodule()", I'm going to update the tracker issue to propose the addition of "types.newclass()" as the dynamic API for the PEP 3115 metaclass protocol. The question now moves to the implementation strategy - whether we redirect to the C machinery as originally proposed (either via buildclass or a new types module) or just reimplement the algorithm in pure Python. The latter is actually quite an appealing concept, since it becomes a cross-check on the native C version.

+1 to a pure Python version.

Cheers, Mark



More information about the Python-Dev mailing list