[Python-checkins] cpython (3.3): Issue #19963: Document that importlib.import_module() will import

brett.cannon python-checkins at python.org
Fri Dec 13 19:58:56 CET 2013


http://hg.python.org/cpython/rev/a44be62026fc
changeset: 87940:a44be62026fc
branch: 3.3
parent: 87938:a14f830196ec
user: Brett Cannon <brett at python.org>
date: Fri Dec 13 13:57:41 2013 -0500
summary:
 Issue #19963: Document that importlib.import_module() will import
parent packages automatically.
files:
 Doc/library/importlib.rst | 7 +++++--
 Misc/NEWS | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -82,10 +82,13 @@
 derived from :func:`importlib.__import__`, including requiring the package
 from which an import is occurring to have been previously imported
 (i.e., *package* must already be imported). The most important difference
- is that :func:`import_module` returns the most nested package or module
- that was imported (e.g. ``pkg.mod``), while :func:`__import__` returns the
+ is that :func:`import_module` returns the specified package or module
+ (e.g. ``pkg.mod``), while :func:`__import__` returns the
 top-level package or module (e.g. ``pkg``).
 
+ .. versionchanged:: 3.3
+ Parent packages are automatically imported.
+
 .. function:: find_loader(name, path=None)
 
 Find the loader for a module, optionally within the specified *path*. If the
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -169,6 +169,9 @@
 Documentation
 -------------
 
+- Issue #19963: Document that importlib.import_module() no longer requires
+ importing parent packages separately.
+
 - Issue #18840: Introduce the json module in the tutorial, and deemphasize
 the pickle module.
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /