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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com