Mercurial > cpython-lru_cache-weakref
comparison Python/thread_foobar.h @ 16862:77a5470299db legacy-trunk
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.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Wed, 28 Feb 2001 22:54:51 +0000 |
| parents | 6f6f965c5e2d |
| children | ebfd87e87884 |
comparison
equal
deleted
inserted
replaced
| 16861:9fa200982583 | 16862:77a5470299db |
|---|
