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