On Fri, May 11, 2012 at 3:31 AM, Barry Warsaw <ba...@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.new_module()", I'm going to update the tracker issue to propose the addition of "types.new_class()" 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 __build_class__ 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. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com