[Python-checkins] CVS: python/dist/src/Lib/test test_scope.py,1.7,1.8

Jeremy Hylton jhylton@users.sourceforge.net
Mon, 26 Feb 2001 20:23:36 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv28404/Lib/test

Modified Files:
	test_scope.py 
Log Message:
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.




Index: test_scope.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_scope.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** test_scope.py	2001/02/19 15:35:26	1.7
--- test_scope.py	2001/02/27 04:23:34	1.8
***************
*** 1,2 ****
--- 1,4 ----
+ from __future__ import nested_scopes
+ 
  from test.test_support import verify, TestFailed, check_syntax