[issue22574] super() and del in the same method leads to UnboundLocalError

2014-10-07 Thread Pierre-Antoine BRAMERET
New submission from Pierre-Antoine BRAMERET: Hi, With the following code: class Base(object): pass class Foo(Base): def __init__(self): super(Foo,self).__init__() if False: del Foo I expect that Foo() would give me a Foo instance. Instead, it raises the following exception

[issue22574] super() and del in the same method leads to UnboundLocalError

2014-10-07 Thread Pierre-Antoine BRAMERET
Pierre-Antoine BRAMERET added the comment: Sorry, I miscopied the last Traceback. Please find the following: Traceback (most recent call last): File "", line 1, in File "", line 4, in __init__ assert Foo UnboundLocalError: local variable 'Foo'

[issue22574] super() and del in the same method leads to UnboundLocalError

2014-10-07 Thread Pierre-Antoine BRAMERET
Pierre-Antoine BRAMERET added the comment: Hi, Tanks for your clear answer. I find it surprising that "del" bounds the name locally, but with little more thinking, it is not... -- resolution: -> not a bug status: open -> closed __