summaryrefslogtreecommitdiff
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-02-27 04:23:34 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2001-02-27 04:23:34 +0000
commite3334e829ed40547ef4122d15c5bfc2abe8ec8da (patch)
tree4719ecd5aeccd03411d875de31f435b59fee85ab /Python/symtable.c
parent0934bae8bf792d6b79e90ad4f6893478c38b04fd (diff)
downloadcpython-e3334e829ed40547ef4122d15c5bfc2abe8ec8da.tar.gz
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 'Python/symtable.c')
-rw-r--r--Python/symtable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 0d2e3243a1..3ec129dfc2 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -43,7 +43,7 @@ PySymtableEntry_New(struct symtable *st, char *name, int type, int lineno)
goto fail;
ste->ste_children = v;
- ste->ste_optimized = 1;
+ ste->ste_optimized = 0;
ste->ste_lineno = lineno;
switch (type) {
case funcdef: