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 <rep...@bugs.python.org> <http://bugs.python.org/issue23722> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com