[New-bugs-announce] [issue33179] Investigate using a context variable for zero-arg super initialisation

Nick Coghlan report at bugs.python.org
Thu Mar 29 10:15:52 EDT 2018


New submission from Nick Coghlan <ncoghlan at gmail.com>:

As noted in https://docs.python.org/3/reference/datamodel.html?#creating-the-class-object, implementing PEP 487 required the introduction of __classcell__ as a way for __build_class__ to pass the zero-arg super() cell object through to type.__new__.

Now that Python 3.7+ offers context variables, we may be able to design a more robust (and better hidden) alternative which stashes the "current zero-arg super cell object" in a context variable, allowing type.__new__ to retrieve it when needed, without having to pass it through the class body execution namespace.

----------
messages: 314650
nosy: Martin.Teichmann, encukou, ncoghlan, yselivanov
priority: normal
severity: normal
status: open
title: Investigate using a context variable for zero-arg super initialisation
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33179>
_______________________________________


More information about the New-bugs-announce mailing list