@@ -18,12 +18,12 @@ implementation of the :keyword:`import` statement (and thus, by extension, the
1818:func: `__import__ ` function) in Python source code. This provides an
1919implementaiton of :keyword: `import ` which is portable to any Python
2020interpreter. This also provides a reference implementation which is easier to
21- read than one in a programming language other than Python.
21+ comprehend than one in a programming language other than Python.
2222
2323Two, the components to implement :keyword: `import ` can be exposed in this
2424package, making it easier for users to create their own custom objects (known
25- generically as importers ) to participate in the import process. Details on
26- providing custom importers can be found in :pep: `302 `.
25+ generically as an :term: ` importer ` ) to participate in the import process.
26+ Details on providing custom importers can be found in :pep: `302 `.
2727
2828.. seealso ::
2929
@@ -126,3 +126,28 @@ find and load modules.
126126
127127 Class method that allows this class to be a :term: `loader ` for frozen
128128 modules.
129+
130+
131+ .. class :: PathFinder
132+
133+ :term: `Finder ` for :data: `sys.path `.
134+
135+ This class does not perfectly mirror the semantics of :keyword: `import ` in
136+ terms of :data: `sys.path `. No implicit path hooks are assumed for
137+ simplification of the class and its semantics.
138+
139+ Only class method are defined by this class to alleviate the need for
140+ instantiation.
141+
142+ .. classmethod :: find_module(fullname, path=None)
143+
144+ Class method that attempts to find a :term: `loader ` for the module
145+ specified by *fullname * either on :data: `sys.path ` or, if defined, on
146+ *path *. For each path entry that is searched,
147+ :data: `sys.path_importer_cache ` is checked. If an non-false object is
148+ found then it is used as the :term: `finder ` to query for the module
149+ being searched for. For no entry is found in
150+ :data: `sys.path_importer_cache `, then :data: `sys.path_hooks ` is
151+ searched for a finder for the path entry and, if found, is stored in
152+ :data: `sys.path_importer_cache ` along with being queried about the
153+ module.
0 commit comments