[issue23722] During metaclass.__init__, super() of the constructed class does not work

Nick Coghlan report at bugs.python.org
Sun Dec 4 01:47:54 EST 2016


Nick Coghlan added the comment:

This latest patch restores the behaviour where a reference to the class cell is returned from the class-defining closure.

That restoration allows __build_class__ to implement a sanity check that ensures that the class referenced from the cell is the one that was just defined, and complain if they don't match.

To give metaclasses like the Django one a chance to adjust, not setting it at all is just a deprecation warning for 3.6, while setting it incorrectly is a TypeError.

----------
stage: needs patch -> commit review
versions: +Python 3.6, Python 3.7 -Python 3.5
Added file: http://bugs.python.org/file45743/issue23722_classcell_reference_validation.diff

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


More information about the Python-bugs-list mailing list