[Python-checkins] cpython: Issue #13959: Document imp.find_module/load_module as deprecated.

brett.cannon python-checkins at python.org
Sun May 13 19:04:27 CEST 2012


http://hg.python.org/cpython/rev/59870239813c
changeset:   76899:59870239813c
user:        Brett Cannon <brett at python.org>
date:        Sun May 13 13:04:21 2012 -0400
summary:
  Issue #13959: Document imp.find_module/load_module as deprecated.

The code itself does not raise a DeprecationWarning as the functions
are technically fine, it's just a bad API. Unfortunately experience
has shown that the terrible API has been exposed in various places,
necessitating that it stick around probably until py4k comes around
since it is such a shift to move over to importlib.find_loader().

files:
  Doc/library/imp.rst |  7 +++++++
  Misc/NEWS           |  3 ++-
  2 files changed, 9 insertions(+), 1 deletions(-)


diff --git a/Doc/library/imp.rst b/Doc/library/imp.rst
--- a/Doc/library/imp.rst
+++ b/Doc/library/imp.rst
@@ -72,6 +72,9 @@
    then use :func:`find_module` with the *path* argument set to ``P.__path__``.
    When *P* itself has a dotted name, apply this recipe recursively.
 
+   .. deprecated:: 3.3
+      Use :func:`importlib.find_loader` instead.
+
 
 .. function:: load_module(name, file, pathname, description)
 
@@ -93,6 +96,10 @@
    it was not ``None``, even when an exception is raised.  This is best done
    using a :keyword:`try` ... :keyword:`finally` statement.
 
+   .. deprecated:: 3.3
+      Unneeded as loaders should be used to load modules and
+      :func:`find_module` is deprecated.
+
 
 .. function:: new_module(name)
 
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -26,7 +26,8 @@
 - Issue #14366: Support lzma compression in zip files.
   Patch by Serhiy Storchaka.
 
-- Issue #13959: Introduce importlib.find_loader().
+- Issue #13959: Introduce importlib.find_loader() and document
+  imp.find_module/load_module as deprecated.
 
 - Issue #14082: shutil.copy2() now copies extended attributes, if possible.
   Patch by Hynek Schlawack.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list