[issue25973] Segmentation fault with nonlocal and two underscores

Alessandro Cucci report at bugs.python.org
Tue Dec 29 07:58:27 EST 2015


Alessandro Cucci added the comment:

I don't think the problem is about the underscores, since this work...

class Foo:
    def f1(self):
        __obj = object()
        def f2():
            nonlocal __obj
            __obj = []
        f2()
        return isinstance(__obj, list)
        
f = Foo()
print(f.f1())

----------
nosy: +acucci

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


More information about the Python-bugs-list mailing list