Daniel Urban <urban.dani...@gmail.com> added the comment:

Here is my first attempt at creating a pure Python version of the 
operator.build_class function (in my previous patch) as types.new_class.

The three added functions (two private and one public) correspond to the 
following functions in my previous patch:
types.new_class -> operator.build_class
types._prepare_ns -> prepare_namespace in typeobject.c
types._calculate_mcls -> calculate_metaclass in typeobject.c (currently 
_PyType_CalculateMetaclass)
(In Python these functions are quite short, so they may be merged. But this 
separation may be better for documentation purposes...)

The tests are mostly the same as in my previous patch.

----------
components: +Library (Lib)
Added file: http://bugs.python.org/file25546/types_new_class.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14588>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to