New submission from Nick Coghlan:

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)
...

----------
assignee: docs@python
components: Documentation
messages: 248036
nosy: docs@python, ncoghlan
priority: normal
severity: normal
status: open
title: Deleting names referencing from enclosed and enclosing scopes

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24796>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to