SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

0 0 110 Python

Add warning/error handlin for problematic nested scopes cases as

described in PEP 227.

symtable_check_unoptimized() warns about import * and exec with "in"
when it is used in a function that contains a nested function with
free variables.  Warnings are issued unless nested scopes are in
effect, in which case these are SyntaxErrors.

symtable_check_shadow() warns about assignments in a function scope
that shadow free variables defined in a nested scope.  This will
always generate a warning -- and will behave differently with nested
scopes than without.

Restore full checking for free vars in children, even when nested
scopes are not enabled.  This is needed to support warnings for
shadowing.

Change symtable_warn() to return an int-- the return value of
PyErr_WarnExplicit.

Sundry cleanup: Remove commented out code.  Break long lines.
J
Jeremy Hylton committed
4419ac1a97d445f3fadacbf7b25c4cfc258c733b
Parent: 150a664