Skip to content

Commit 4672060

Browse files
committed
Update pkgutil docs to reference appropriate finder and loader object documentation.
Initial patch contributed by Jaysinh shukla.
1 parent 6d99980 commit 4672060

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

Doc/library/pkgutil.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ support.
4646

4747
.. class:: ImpImporter(dirname=None)
4848

49-
:pep:`302` Importer that wraps Python's "classic" import algorithm.
49+
:pep:`302` Finder that wraps Python's "classic" import algorithm.
5050

51-
If *dirname* is a string, a :pep:`302` importer is created that searches that
52-
directory. If *dirname* is ``None``, a :pep:`302` importer is created that
51+
If *dirname* is a string, a :pep:`302` finder is created that searches that
52+
directory. If *dirname* is ``None``, a :pep:`302` finder is created that
5353
searches the current :data:`sys.path`, plus any modules that are frozen or
5454
built-in.
5555

@@ -63,7 +63,7 @@ support.
6363

6464
.. class:: ImpLoader(fullname, file, filename, etc)
6565

66-
:pep:`302` Loader that wraps Python's "classic" import algorithm.
66+
:term:`Loader` that wraps Python's "classic" import algorithm.
6767

6868
.. deprecated:: 3.3
6969
This emulation is no longer needed, as the standard import mechanism
@@ -72,7 +72,7 @@ support.
7272

7373
.. function:: find_loader(fullname)
7474

75-
Retrieve a :pep:`302` module loader for the given *fullname*.
75+
Retrieve a module :term:`loader` for the given *fullname*.
7676

7777
This is a backwards compatibility wrapper around
7878
:func:`importlib.util.find_spec` that converts most failures to
@@ -88,9 +88,9 @@ support.
8888

8989
.. function:: get_importer(path_item)
9090

91-
Retrieve a :pep:`302` importer for the given *path_item*.
91+
Retrieve a :term:`finder` for the given *path_item*.
9292

93-
The returned importer is cached in :data:`sys.path_importer_cache` if it was
93+
The returned finder is cached in :data:`sys.path_importer_cache` if it was
9494
newly created by a path hook.
9595

9696
The cache (or part of it) can be cleared manually if a rescan of
@@ -103,7 +103,7 @@ support.
103103

104104
.. function:: get_loader(module_or_name)
105105

106-
Get a :pep:`302` "loader" object for *module_or_name*.
106+
Get a :term:`loader` object for *module_or_name*.
107107

108108
If the module or package is accessible via the normal import mechanism, a
109109
wrapper around the relevant part of that machinery is returned. Returns
@@ -121,16 +121,16 @@ support.
121121

122122
.. function:: iter_importers(fullname='')
123123

124-
Yield :pep:`302` importers for the given module name.
124+
Yield :term:`finder` objects for the given module name.
125125

126-
If fullname contains a '.', the importers will be for the package
126+
If fullname contains a '.', the finders will be for the package
127127
containing fullname, otherwise they will be all registered top level
128-
importers (i.e. those on both sys.meta_path and sys.path_hooks).
128+
finders (i.e. those on both sys.meta_path and sys.path_hooks).
129129

130130
If the named module is in a package, that package is imported as a side
131131
effect of invoking this function.
132132

133-
If no module name is specified, all top level importers are produced.
133+
If no module name is specified, all top level finders are produced.
134134

135135
.. versionchanged:: 3.3
136136
Updated to be based directly on :mod:`importlib` rather than relying
@@ -201,7 +201,7 @@ support.
201201

202202
Get a resource from a package.
203203

204-
This is a wrapper for the :pep:`302` loader :func:`get_data` API. The
204+
This is a wrapper for the :term:`loader` :func:`get_data` API. The
205205
*package* argument should be the name of a package, in standard module format
206206
(``foo.bar``). The *resource* argument should be in the form of a relative
207207
filename, using ``/`` as the path separator. The parent directory name
@@ -216,5 +216,5 @@ support.
216216
d = os.path.dirname(sys.modules[package].__file__)
217217
data = open(os.path.join(d, resource), 'rb').read()
218218

219-
If the package cannot be located or loaded, or it uses a :pep:`302` loader
219+
If the package cannot be located or loaded, or it uses a :term:`loader`
220220
which does not support :func:`get_data`, then ``None`` is returned.

Lib/pkgutil.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def iter_zipimport_modules(importer, prefix=''):
395395

396396

397397
def get_importer(path_item):
398-
"""Retrieve a PEP 302 importer for the given path item
398+
"""Retrieve a finder for the given path item
399399
400400
The returned importer is cached in sys.path_importer_cache
401401
if it was newly created by a path hook.
@@ -419,7 +419,7 @@ def get_importer(path_item):
419419

420420

421421
def iter_importers(fullname=""):
422-
"""Yield PEP 302 importers for the given module name
422+
"""Yield finders for the given module name
423423
424424
If fullname contains a '.', the importers will be for the package
425425
containing fullname, otherwise they will be all registered top level
@@ -448,7 +448,7 @@ def iter_importers(fullname=""):
448448

449449

450450
def get_loader(module_or_name):
451-
"""Get a PEP 302 "loader" object for module_or_name
451+
"""Get a "loader" object for module_or_name
452452
453453
Returns None if the module cannot be found or imported.
454454
If the named module is not already imported, its containing package
@@ -472,7 +472,7 @@ def get_loader(module_or_name):
472472

473473

474474
def find_loader(fullname):
475-
"""Find a PEP 302 "loader" object for fullname
475+
"""Find a "loader" object for fullname
476476
477477
This is a backwards compatibility wrapper around
478478
importlib.util.find_spec that converts most failures to ImportError

0 commit comments

Comments
 (0)