
ncoghlan at gmail
May 10, 2012, 5:56 PM
Post #34 of 37
(153 views)
Permalink
|
On Fri, May 11, 2012 at 3:31 AM, Barry Warsaw <barry [at] python> 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 | ncoghlan [at] gmail | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev [at] python http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com
|