2012/5/7 Nick Coghlan <ncogh...@gmail.com>: > A while back I pointed out that there's no easy PEP 3115 compliant way > to dynamically create a class (finding the right metaclass, calling > __prepare__, etc). > > I initially proposed providing this as operator.build_class, and > Daniel Urban created a patch that implements that API > (http://bugs.python.org/issue14588). > > However, in starting to write the documentation for the new API, I > realised that the operator module really isn't the right home for the > functionality. > > Instead, I'm now thinking we should add a _types C extension module > and expose the new function as types.build_class(). I don't want to > add an entire new module just for this feature, and the types module > seems like an appropriate home for it.
Actually, there used to be a _types C module before we figured out that all the types could be extracted in Python. :) Maybe you could make it a static or class method of type? -- Regards, Benjamin _______________________________________________ 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