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
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'
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
__