A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-February/108404.html below:

[Python-Dev] Unbinding a name referenced by an enclosing scope

[Python-Dev] Unbinding a name referenced by an enclosing scope - error in documentation? [Python-Dev] Unbinding a name referenced by an enclosing scope - error in documentation?Greg Ewing greg.ewing at canterbury.ac.nz
Sat Feb 26 23:30:43 CET 2011
From: Grigory Javadyan
> ... def f():
> ...     a = 42
> ...     def g():
> ...             nonlocal a
> ...             del a
> ...
> SyntaxError: can not delete variable 'a' referenced in nested scope

Is there a rational for this? It seems inconsistent -- if you can
assign to names in outer scopes, you should be able to del them
as well.

-- 
Greg

This email may be confidential and subject to legal privilege, it may
not reflect the views of the University of Canterbury, and it is not
guaranteed to be virus free. If you are not an intended recipient,
please notify the sender immediately and erase all copies of the message
and any attachments.

Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more
information.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4