]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Extend support for from __future__ import nested_scopes
authorJeremy Hylton <jeremy@alum.mit.edu>
Thu, 22 Mar 2001 02:47:58 +0000 (02:47 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Thu, 22 Mar 2001 02:47:58 +0000 (02:47 +0000)
commitbc32024769eecd3c2251e00850e6a5c003aa9253
treeac22247a92d89b1952de8defcb42c17f07e24a7b
parent061d106a0f56c5b4171ad8c56ecfaa6cefb27385
Extend support for from __future__ import nested_scopes

If a module has a future statement enabling nested scopes, they are
also enable for the exec statement and the functions compile() and
execfile() if they occur in the module.

If Python is run with the -i option, which enters interactive mode
after executing a script, and the script it runs enables nested
scopes, they are also enabled in interactive mode.

XXX The use of -i with -c "from __future__ import nested_scopes" is
not supported.  What's the point?

To support these changes, many function variants have been added to
pythonrun.c.  All the variants names end with Flags and they take an
extra PyCompilerFlags * argument.  It is possible that this complexity
will be eliminated in a future version of the interpreter in which
nested scopes are not optional.
Include/pythonrun.h
Modules/main.c
Python/bltinmodule.c
Python/ceval.c
Python/pythonrun.c