This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients docs@python, ncoghlan
Date 2015-08-05.13:05:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438779917.48.0.0299421063838.issue24796@psf.upfronthosting.co.za>
In-reply-to
Content
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)
...
History
Date User Action Args
2015-08-05 13:05:18ncoghlansetrecipients: + ncoghlan, docs@python
2015-08-05 13:05:17ncoghlansetmessageid: <1438779917.48.0.0299421063838.issue24796@psf.upfronthosting.co.za>
2015-08-05 13:05:15ncoghlanlinkissue24796 messages
2015-08-05 13:05:12ncoghlancreate