]> granicus.if.org Git - python/commit
Provisional implementation of PEP 3104.
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 27 Feb 2007 06:50:52 +0000 (06:50 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 27 Feb 2007 06:50:52 +0000 (06:50 +0000)
commit81e9502df69394821416309c7c4b5357af51f4d5
treead38831cbebfb32890c0c57cb8b36f653300c69f
parent8b41c3dc28a16da97af50cc5f7b884db2cea7b0c
Provisional implementation of PEP 3104.

Add nonlocal_stmt to Grammar and Nonlocal node to AST.  They both
parallel the definitions for globals.  The symbol table treats
variables declared as nonlocal just like variables that are free
implicitly.

This change is missing the language spec changes, but makes some
decisions about what the spec should say via the unittests.  The PEP
is silent on a number of decisions, so we should review those before
claiming that nonlocal is complete.

Thomas Wouters made the grammer and ast changes.  Jeremy Hylton added
the symbol table changes and the tests.  Pete Shinners and Neal
Norwitz helped review the code.
12 files changed:
Grammar/Grammar
Include/Python-ast.h
Include/graminit.h
Include/symtable.h
Lib/test/test_scope.py
Lib/test/test_syntax.py
Parser/Python.asdl
Python/Python-ast.c
Python/ast.c
Python/compile.c
Python/graminit.c
Python/symtable.c