[issue28884] Python 3.5.2 non-segfaulting bugs (from PyPy)

Armin Rigo report at bugs.python.org
Tue Dec 6 06:59:25 EST 2016


Armin Rigo added the comment:

(B9) CPython 3.5.2: this ``nonlocal`` seems not to have a reasonable
  effect (note that if we use a different name instead of ``__class__``,
  this example correctly complain that there is no binding in the outer
  scope of ``Y``)::

    class Y:
        class X:
            nonlocal __class__
            __class__ = 42
        print(locals()['__class__'])     # 42
        print(__class__)                 # but this is a NameError

----------

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


More information about the Python-bugs-list mailing list