summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2007-02-27 06:50:52 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2007-02-27 06:50:52 +0000
commit8110a89fde7e127e8234d14226521a586aceff0f (patch)
tree5bbd098f9676d25ff1b2f0003d781aa02ee0a816 /Python/compile.c
parentb5b81e55d468ccd199f7b9a3d8705872304757ae (diff)
downloadcpython-8110a89fde7e127e8234d14226521a586aceff0f.tar.gz
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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 7f0fc503bb..1e4dddf891 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) {