changeset: 78097:416cd57d38cf parent: 78095:8a44e7c0fa30 parent: 78096:4880aac5c665 user: Nick Coghlan date: Sun Jul 15 00:38:43 2012 +1000 files: Misc/NEWS description: Merge #15230 doc updates from 3.2 diff -r 8a44e7c0fa30 -r 416cd57d38cf Doc/library/runpy.rst --- a/Doc/library/runpy.rst Sun Jul 15 00:07:43 2012 +1000 +++ b/Doc/library/runpy.rst Sun Jul 15 00:38:43 2012 +1000 @@ -14,6 +14,15 @@ line switch that allows scripts to be located using the Python module namespace rather than the filesystem. +Note that this is *not* a sandbox module - all code is executed in the +current process, and any side effects (such as cached imports of other +modules) will remain in place after the functions have returned. + +Furthermore, any functions and classes defined by the executed code are not +guaranteed to work correctly after a :mod:`runpy` function has returned. +If that limitation is not acceptable for a given use case, :mod:`importlib` +is likely to be a more suitable choice than this module. + The :mod:`runpy` module provides two functions: @@ -141,3 +150,5 @@ PEP written and implemented by Nick Coghlan. :ref:`using-on-general` - CPython command line details + + The :func:`importlib.import_module` function diff -r 8a44e7c0fa30 -r 416cd57d38cf Misc/NEWS --- a/Misc/NEWS Sun Jul 15 00:07:43 2012 +1000 +++ b/Misc/NEWS Sun Jul 15 00:38:43 2012 +1000 @@ -122,6 +122,9 @@ Documentation ------------- +- Issue #15230: Clearly document some of the limitations of the runpy + module and nudge readers towards importlib when appropriate. + - Issue #15053: Copy Python 3.3 import lock change notice to all relevant functions in imp instead of just at the top of the relevant section. @@ -1184,12 +1187,12 @@ Based on patch from Hervé Coatanhay. - Issue #14321: Do not run pgen during the build if files are up to date. + Documentation ------------- - Issue #14034: added the argparse tutorial. - - Issue #14324: Fix configure tests for cross builds. - Issue #14327: Call AC_CANONICAL_HOST in configure.ac and check in