]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19963: Document that importlib.import_module() will import
authorBrett Cannon <brett@python.org>
Fri, 13 Dec 2013 18:57:41 +0000 (13:57 -0500)
committerBrett Cannon <brett@python.org>
Fri, 13 Dec 2013 18:57:41 +0000 (13:57 -0500)
parent packages automatically.

Doc/library/importlib.rst
Misc/NEWS

index efd027b316231ce0f3cc5337ca6b6d9ed0be490c..92339dcd85c9edd4bdf03be8c86c8b358a428ba1 100644 (file)
@@ -82,10 +82,13 @@ Functions
     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
index a66834944dcf21adc19cc02fd56e614a993e84b7..a1f6970aa11aff2b87fb98dade96c6fbd42bf364 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -169,6 +169,9 @@ Tests
 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.