[Python-checkins] cpython (merge 3.5 -> default): [merge from 3.5] - Update pkgutil docs to reference appropriate finder and

senthil.kumaran python-checkins at python.org
Mon Sep 5 20:17:23 EDT 2016


https://hg.python.org/cpython/rev/ee58ece83391
changeset:   103099:ee58ece83391
parent:      103097:58b093fd094f
parent:      103098:ecbad01262c8
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Mon Sep 05 17:16:06 2016 -0700
summary:
  [merge from 3.5] - Update pkgutil docs to reference appropriate finder and loader object documentation.

Initial patch contributed by Jaysinh shukla.

files:
  Doc/library/pkgutil.rst |  14 +++++++-------
  Lib/pkgutil.py          |   8 ++++----
  2 files changed, 11 insertions(+), 11 deletions(-)


diff --git a/Doc/library/pkgutil.rst b/Doc/library/pkgutil.rst
--- a/Doc/library/pkgutil.rst
+++ b/Doc/library/pkgutil.rst
@@ -63,7 +63,7 @@
 
 .. class:: ImpLoader(fullname, file, filename, etc)
 
-   :pep:`302` Loader that wraps Python's "classic" import algorithm.
+   :term:`Loader` that wraps Python's "classic" import algorithm.
 
    .. deprecated:: 3.3
       This emulation is no longer needed, as the standard import mechanism
@@ -72,7 +72,7 @@
 
 .. function:: find_loader(fullname)
 
-   Retrieve a :pep:`302` module loader for the given *fullname*.
+   Retrieve a module :term:`loader` for the given *fullname*.
 
    This is a backwards compatibility wrapper around
    :func:`importlib.util.find_spec` that converts most failures to
@@ -88,7 +88,7 @@
 
 .. function:: get_importer(path_item)
 
-   Retrieve a :pep:`302` finder for the given *path_item*.
+   Retrieve a :term:`finder` for the given *path_item*.
 
    The returned finder is cached in :data:`sys.path_importer_cache` if it was
    newly created by a path hook.
@@ -103,7 +103,7 @@
 
 .. function:: get_loader(module_or_name)
 
-   Get a :pep:`302` "loader" object for *module_or_name*.
+   Get a :term:`loader` object for *module_or_name*.
 
    If the module or package is accessible via the normal import mechanism, a
    wrapper around the relevant part of that machinery is returned.  Returns
@@ -121,7 +121,7 @@
 
 .. function:: iter_importers(fullname='')
 
-   Yield :pep:`302` finders for the given module name.
+   Yield :term:`finder` objects for the given module name.
 
    If fullname contains a '.', the finders will be for the package
    containing fullname, otherwise they will be all registered top level
@@ -201,7 +201,7 @@
 
    Get a resource from a package.
 
-   This is a wrapper for the :pep:`302` loader :func:`get_data` API.  The
+   This is a wrapper for the :term:`loader` :func:`get_data` API.  The
    *package* argument should be the name of a package, in standard module format
    (``foo.bar``).  The *resource* argument should be in the form of a relative
    filename, using ``/`` as the path separator.  The parent directory name
@@ -216,5 +216,5 @@
       d = os.path.dirname(sys.modules[package].__file__)
       data = open(os.path.join(d, resource), 'rb').read()
 
-   If the package cannot be located or loaded, or it uses a :pep:`302` loader
+   If the package cannot be located or loaded, or it uses a :term:`loader`
    which does not support :func:`get_data`, then ``None`` is returned.
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
--- a/Lib/pkgutil.py
+++ b/Lib/pkgutil.py
@@ -395,7 +395,7 @@
 
 
 def get_importer(path_item):
-    """Retrieve a PEP 302 finder for the given path item
+    """Retrieve a finder for the given path item
 
     The returned finder is cached in sys.path_importer_cache
     if it was newly created by a path hook.
@@ -419,7 +419,7 @@
 
 
 def iter_importers(fullname=""):
-    """Yield PEP 302 finders for the given module name
+    """Yield finders for the given module name
 
     If fullname contains a '.', the finders will be for the package
     containing fullname, otherwise they will be all registered top level
@@ -448,7 +448,7 @@
 
 
 def get_loader(module_or_name):
-    """Get a PEP 302 "loader" object for module_or_name
+    """Get a "loader" object for module_or_name
 
     Returns None if the module cannot be found or imported.
     If the named module is not already imported, its containing package
@@ -472,7 +472,7 @@
 
 
 def find_loader(fullname):
-    """Find a PEP 302 "loader" object for fullname
+    """Find a "loader" object for fullname
 
     This is a backwards compatibility wrapper around
     importlib.util.find_spec that converts most failures to ImportError

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


More information about the Python-checkins mailing list