[python-committers] 3.6 release blocker review request

Nick Coghlan ncoghlan at gmail.com
Sun Dec 4 03:54:51 EST 2016


Hi folks,

The PEP 487 implementation included some changes to the way the
implicit __class__ cell is initialised in order to allow zero-argument
super() to work properly in class methods called from __set_name__ and
__init_subclass__ implementations.

Unfortunately, the specific implementation chosen turned out to have
an obscure incompatibility with certain custom metaclasses, notably
including the metaclass for Model objects in Django. While there's a
patch pending to fix the incompatibility in Django, this should really
be a deprecation warning on the CPython side, rather than an abrupt
compatibility break.

The latest patches attached to issue 23722 partially revert the
previous changes, and update the data model documentation to cover the
new constraints on custom metaclass implementations that want to
support zero-argument super():

* http://bugs.python.org/issue23722#msg282317

Aside from the unintentional backwards compatibility break, the main
reason this is a release blocker is that in order to detect the
problematic case, we need to revert some of the changes previously
made to the bytecode generated for class statements (some opcodes had
been dropped as no longer needed, but now we need them again for error
detection purposes).

Regards,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the python-committers mailing list