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/2010-December/106848.html below:

[Python-Dev] nonlocal x = value

[Python-Dev] nonlocal x = value [Python-Dev] nonlocal x = valueStefan Behnel stefan_ml at behnel.de
Fri Dec 17 08:19:07 CET 2010
Hi,

it seems that Py3 doesn't support setting a "nonlocal" value as part of the 
"nonlocal" command

     Python 3.2a4+ (py3k:86480, Nov 16 2010, 16:43:22)
     [GCC 4.4.3] on linux2
     Type "help", "copyright", "credits" or "license" for more information.
     >>> def x():
     ...   y = 5
     ...   def f():
     ...     nonlocal y = 6
       File "<stdin>", line 4
         nonlocal y = 6
                    ^
     SyntaxError: invalid syntax

even though the PEP clearly describes this feature.

http://www.python.org/dev/peps/pep-3104/#proposed-solution

Either the PEP or the implementation should be updated. Personally, I think 
the PEP should be changed as I think that the syntax complicates the 
grammar more than it's worth. Also, the moratorium applies here, given that 
Py3.1 does not implement this.

Comments?

Stefan

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