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/108397.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?Benjamin Peterson benjamin at python.org
Sat Feb 26 22:33:57 CET 2011
2011/2/26 Grigory Javadyan <grigory.javadyan at gmail.com>:
>>>> def f():
> ...     a = 42
> ...     def g():
> ...             nonlocal a
> ...             del a
> ...
> SyntaxError: can not delete variable 'a' referenced in nested scope
>
> Which looks weird, because the name is referenced in the _enclosed_
> scope, not the _enclosing_ scope. Is there a typo in the documentation
> or am I missing something?

Actually you can do that now 3.2+. I've now removed that sentence;.



-- 
Regards,
Benjamin
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