diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/import.rst | 8 | ||||
-rw-r--r-- | Doc/library/pkgutil.rst | 18 |
2 files changed, 13 insertions, 13 deletions
diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst index 2936f4f..5a083ce 100644 --- a/Doc/c-api/import.rst +++ b/Doc/c-api/import.rst @@ -207,13 +207,13 @@ Importing Modules .. c:function:: PyObject* PyImport_GetImporter(PyObject *path) - Return an importer object for a :data:`sys.path`/:attr:`pkg.__path__` item + Return a finder object for a :data:`sys.path`/:attr:`pkg.__path__` item *path*, possibly by fetching it from the :data:`sys.path_importer_cache` dict. If it wasn't yet cached, traverse :data:`sys.path_hooks` until a hook is found that can handle the path item. Return ``None`` if no hook could; - this tells our caller it should fall back to the built-in import mechanism. - Cache the result in :data:`sys.path_importer_cache`. Return a new reference - to the importer object. + this tells our caller that the :term:`path based finder` could not find a + finder for this path item. Cache the result in :data:`sys.path_importer_cache`. + Return a new reference to the finder object. .. c:function:: void _PyImport_Init() diff --git a/Doc/library/pkgutil.rst b/Doc/library/pkgutil.rst index 26c5ac0..1f11a2d 100644 --- a/Doc/library/pkgutil.rst +++ b/Doc/library/pkgutil.rst @@ -46,10 +46,10 @@ support. .. class:: ImpImporter(dirname=None) - :pep:`302` Importer that wraps Python's "classic" import algorithm. + :pep:`302` Finder that wraps Python's "classic" import algorithm. - If *dirname* is a string, a :pep:`302` importer is created that searches that - directory. If *dirname* is ``None``, a :pep:`302` importer is created that + If *dirname* is a string, a :pep:`302` finder is created that searches that + directory. If *dirname* is ``None``, a :pep:`302` finder is created that searches the current :data:`sys.path`, plus any modules that are frozen or built-in. @@ -88,9 +88,9 @@ support. .. function:: get_importer(path_item) - Retrieve a :pep:`302` importer for the given *path_item*. + Retrieve a :pep:`302` finder for the given *path_item*. - The returned importer is cached in :data:`sys.path_importer_cache` if it was + The returned finder is cached in :data:`sys.path_importer_cache` if it was newly created by a path hook. The cache (or part of it) can be cleared manually if a rescan of @@ -121,16 +121,16 @@ support. .. function:: iter_importers(fullname='') - Yield :pep:`302` importers for the given module name. + Yield :pep:`302` finders for the given module name. - If fullname contains a '.', the importers will be for the package + If fullname contains a '.', the finders will be for the package containing fullname, otherwise they will be all registered top level - importers (i.e. those on both sys.meta_path and sys.path_hooks). + finders (i.e. those on both sys.meta_path and sys.path_hooks). If the named module is in a package, that package is imported as a side effect of invoking this function. - If no module name is specified, all top level importers are produced. + If no module name is specified, all top level finders are produced. .. versionchanged:: 3.3 Updated to be based directly on :mod:`importlib` rather than relying |