diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2007-02-27 06:50:52 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2007-02-27 06:50:52 (GMT) |
commit | 81e9502df69394821416309c7c4b5357af51f4d5 (patch) | |
tree | ad38831cbebfb32890c0c57cb8b36f653300c69f /Python/compile.c | |
parent | 8b41c3dc28a16da97af50cc5f7b884db2cea7b0c (diff) | |
download | cpython-81e9502df69394821416309c7c4b5357af51f4d5.zip cpython-81e9502df69394821416309c7c4b5357af51f4d5.tar.gz cpython-81e9502df69394821416309c7c4b5357af51f4d5.tar.bz2 |
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.
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c index 7f0fc50..1e4dddf 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2239,6 +2239,7 @@ compiler_visit_stmt(struct compiler *c, stmt_ty s) case ImportFrom_kind: return compiler_from_import(c, s); case Global_kind: + case Nonlocal_kind: break; case Expr_kind: if (c->c_interactive && c->c_nestlevel <= 1) { |