Georg Brandl added the comment:
The docs already contain the following note:
.. note::
The default *locals* act as described for function :func:`locals`
below:
modifications to the default *locals* dictionary should not be
attempted.
Pass an explicit *locals* dictionary if
Nick Coghlan added the comment:
This is a largely inevitable consequence of the conversion from a
statement to a function - the interpreter eval loop for the exec
statement used to do some fancy footwork to make locals() modifications
work, but with exec becoming just another builtin function th
New submission from Peter Mawhorter :
The behavior of the built-in exec() function differs in Python3.1 from
the behavior in Python 2.6 when only a single argument is passed.
Additionally, the documentation for the function does not suggest the
behavior that it has. In Python2.6, an exec statemen