Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(157154)

Unified Diff: Doc/whatsnew/3.6.rst

Issue 23722: During metaclass.__init__, super() of the constructed class does not work
Patch Set: Created 3 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
--- a/Doc/whatsnew/3.6.rst Sat Dec 03 15:57:00 2016 -0800
+++ b/Doc/whatsnew/3.6.rst Sun Dec 04 22:38:04 2016 +1000
@@ -351,6 +351,10 @@
class Plugin2(PluginBase):
pass
+In order to allow zero-argument :func:`super` calls to work correctly from
+``__init_subclass__`` implementations, custom metaclasses must ensure that
+the new ``__classcell__`` namespace entry is propagated to ``type.__new__``.
+
.. seealso::
:pep:`487` -- Simpler customization of class creation
@@ -2235,6 +2239,11 @@
on a ZipFile created with mode ``'r'`` will raise a :exc:`ValueError`.
Previously, a :exc:`RuntimeError` was raised in those scenarios.
+* when custom metaclasses are combined with zero-argument :func:`super` or
+ direct references from methods to the implicit ``__class__`` closure
+ variable, the implicit ``__classcell__`` namespace entry must now be passed
+ up to ``type.__new__`` for initialisation. Failing to do so will result in
+ a :exc:`DeprecationWarning` in 3.6 and a :exc:`RuntimeWarning` in the future.
Changes in the C API
--------------------

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+