Message248036
While committing issue #24129, I noticed the following in the execution model documentation:
==================
If a variable is referenced in an enclosing scope, it is illegal to delete the name. An error will be reported at compile time.
==================
I'm not sure what that means, as both of the following compiled fine for me under 3.4.2:
>>> def f():
... x = 1
... def g():
... nonlocal x
... del x
...
>>> def f():
... x = 1
... del x
... def g():
... print(x)
... |
|
Date |
User |
Action |
Args |
2015-08-05 13:05:18 | ncoghlan | set | recipients:
+ ncoghlan, docs@python |
2015-08-05 13:05:17 | ncoghlan | set | messageid: <1438779917.48.0.0299421063838.issue24796@psf.upfronthosting.co.za> |
2015-08-05 13:05:15 | ncoghlan | link | issue24796 messages |
2015-08-05 13:05:12 | ncoghlan | create | |
|