]> granicus.if.org Git - python/commitdiff
Issue #13557: Clarify effect of giving two different namespaces to exec or
authorTerry Jan Reedy <tjreedy@udel.edu>
Sun, 8 Jul 2012 21:36:14 +0000 (17:36 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Sun, 8 Jul 2012 21:36:14 +0000 (17:36 -0400)
execfile().

Doc/library/functions.rst
Misc/NEWS

index 3fcd6941c21ea1e8ca1e72da1a22706156927fe6..b6252e629b3fa8dbb8852bedc31a7de790a7df15 100644 (file)
@@ -417,7 +417,10 @@ are always available.  They are listed here in alphabetical order.
    current scope.  If only *globals* is provided, it must be a dictionary, which
    will be used for both the global and the local variables.  If *globals* and
    *locals* are given, they are used for the global and local variables,
-   respectively.  If provided, *locals* can be any mapping object.
+   respectively.  If provided, *locals* can be any mapping object.  Remember
+   that at module level, globals and locals are the same dictionary. If exec
+   gets two separate objects as *globals* and *locals*, the code will be
+   executed as if it were embedded in a class definition.
 
    If the *globals* dictionary does not contain a value for the key
    ``__builtins__``, a reference to the dictionary of the built-in module
index 5c05e0257c8126f643884e7aba9a029e847b9542..2e2b03fb654b2a910785598b3ea36101e1e12386 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -380,14 +380,14 @@ Build
 Documentation
 -------------
 
+- Issue #13557: Clarify effect of giving two different namespaces to exec or
+  execfile().
+
 - Issue #8799: Fix and improve the threading.Condition documentation.
 
 - Issue #14943: Correct a default argument value for winreg.OpenKey
   and correctly list the argument names in the function's explanation.
 
-Documentation
--------------
-
 - Issue #14034: added the argparse tutorial.
 
 Tools/Demos