diff -r 534a9e274d88 Doc/reference/simple_stmts.rst --- a/Doc/reference/simple_stmts.rst Thu May 12 07:47:06 2011 +0200 +++ b/Doc/reference/simple_stmts.rst Thu May 12 11:58:58 2011 -0400 @@ -989,10 +989,15 @@ :keyword:`exec` statement. In all cases, if the optional parts are omitted, the code is executed in the -current scope. If only the first expression after :keyword:`in` is specified, +current scope. If only the first expression after ``in`` is specified, it should be a dictionary, which will be used for both the global and the local variables. If two expressions are given, they are used for the global and local -variables, respectively. If provided, *locals* can be any mapping object. +variables, respectively. If provided, *locals* can be any mapping object. When +the code contains only the first expression after ``in`` or the same dictionary +is used for both the global and local variables, the code is executed in a new +top-level scope. However, when two different objects are used for the global +and local variables, the code is executed as if it were in a class statement in +a new top-level scope. .. versionchanged:: 2.4 Formerly, *locals* was required to be a dictionary.