summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_scope.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-02-27 04:23:34 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-02-27 04:23:34 (GMT)
commit29906eef3a56c43a4cd68a8706c75844b2384e59 (patch)
treecc45c3aa170794c190407c7a0dc7781aa3be74da /Lib/test/test_scope.py
parent2a5130ed20472ba7b3e5442e5083a3a1570cc611 (diff)
downloadcpython-29906eef3a56c43a4cd68a8706c75844b2384e59.zip
cpython-29906eef3a56c43a4cd68a8706c75844b2384e59.tar.gz
cpython-29906eef3a56c43a4cd68a8706c75844b2384e59.tar.bz2
Preliminary support for future nested scopes
compile.h: #define NESTED_SCOPES_DEFAULT 0 for Python 2.1 __future__ feature name: "nested_scopes" symtable.h: Add st_nested_scopes slot. Define flags to track exec and import star. Lib/test/test_scope.py: requires nested scopes compile.c: Fiddle with error messages. Reverse the sense of ste_optimized flag on PySymtableEntryObjects. If it is true, there is an optimization conflict. Modify get_ref_type to respect st_nested_scopes flags. Refactor symtable_load_symbols() into several smaller functions, which use struct symbol_info to share variables. In new function symtable_update_flags(), raise an error or warning for import * or bare exec that conflicts with nested scopes. Also, modify handle for free variables to respect st_nested_scopes flag. In symtable_init() assign st_nested_scopes flag to NESTED_SCOPES_DEFAULT (defined in compile.h). Add preliminary and often incorrect implementation of symtable_check_future(). Add symtable_lookup() helper for future use.
Diffstat (limited to 'Lib/test/test_scope.py')
-rw-r--r--Lib/test/test_scope.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py
index 322431d..d64cead 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -1,3 +1,5 @@
+from __future__ import nested_scopes
+
from test.test_support import verify, TestFailed, check_syntax
print "1. simple nesting"