[docs] [issue28437] Class definition is not consistent with types.new_class

Neil Girdhar report at bugs.python.org
Sat Oct 15 13:49:51 EDT 2016


Neil Girdhar added the comment:

The documentation suggests that you can have a metaclass that does is not the "most derived metaclass" provided you specify one that is not an instance of type.  This doesn't work in CPython, so I would suggest fixing the documentation using the text I provided.

After that, it should be clear that there's no reason for "if isinstance(meta, type):" in the code, and the Python code should be restructured.

The point is that these two functions drifted apart somewhere around Python 3, and they need to be brought back together.  I only discovered this because it was possible in Python 2 to have a non-type metaclass that is not the most derived metaclass.  That has disappeared in CPython 3, except from the documentation and Lib.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28437>
_______________________________________


More information about the docs mailing list