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 steven.daprano
Recipients docs@python, ncoghlan, steven.daprano
Date 2015-08-05.14:48:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438786135.13.0.789014098533.issue24796@psf.upfronthosting.co.za>
In-reply-to
Content
I wonder if it is a left-over from the behaviour prior to 3.2? In 3.1, I
get this syntax error:

py> def outer():
...     spam = 1
...     def inner():
...             nonlocal spam
...             del spam
...     inner()
...
SyntaxError: can not delete variable 'spam' referenced in nested scope

See also the "Changed in 3.2" comment here:

https://docs.python.org/3/reference/simple_stmts.html#the-del-statement
History
Date User Action Args
2015-08-05 14:48:57steven.dapranosetrecipients: + steven.daprano, ncoghlan, docs@python
2015-08-05 14:48:55steven.dapranosetmessageid: <1438786135.13.0.789014098533.issue24796@psf.upfronthosting.co.za>
2015-08-05 14:48:54steven.dapranolinkissue24796 messages
2015-08-05 14:48:49steven.dapranocreate