@@ -127,28 +127,6 @@ Functions
127127 .. versionchanged :: 3.3
128128 Parent packages are automatically imported.
129129
130- .. function :: find_loader(name, path=None)
131-
132- Find the loader for a module, optionally within the specified *path *. If the
133- module is in :attr: `sys.modules `, then ``sys.modules[name].__loader__ `` is
134- returned (unless the loader would be ``None `` or is not set, in which case
135- :exc: `ValueError ` is raised). Otherwise a search using :attr: `sys.meta_path `
136- is done. ``None `` is returned if no loader is found.
137-
138- A dotted name does not have its parents implicitly imported as that requires
139- loading them and that may not be desired. To properly import a submodule you
140- will need to import all parent packages of the submodule and use the correct
141- argument to *path *.
142-
143- .. versionadded :: 3.3
144-
145- .. versionchanged :: 3.4
146- If ``__loader__ `` is not set, raise :exc: `ValueError `, just like when the
147- attribute is set to ``None ``.
148-
149- .. deprecated :: 3.4
150- Use :func: `importlib.util.find_spec ` instead.
151-
152130.. function :: invalidate_caches()
153131
154132 Invalidate the internal caches of finders stored at
@@ -247,7 +225,6 @@ are also provided to help in implementing the core ABCs.
247225ABC hierarchy::
248226
249227 object
250- +-- Finder (deprecated)
251228 +-- MetaPathFinder
252229 +-- PathEntryFinder
253230 +-- Loader
@@ -258,36 +235,14 @@ ABC hierarchy::
258235 +-- SourceLoader
259236
260237
261- .. class :: Finder
262-
263- An abstract base class representing a :term: `finder `.
264-
265- .. deprecated :: 3.3
266- Use :class: `MetaPathFinder ` or :class: `PathEntryFinder ` instead.
267-
268- .. abstractmethod :: find_module(fullname, path=None)
269-
270- An abstract method for finding a :term: `loader ` for the specified
271- module. Originally specified in :pep: `302 `, this method was meant
272- for use in :data: `sys.meta_path ` and in the path-based import subsystem.
273-
274- .. versionchanged :: 3.4
275- Returns ``None `` when called instead of raising
276- :exc: `NotImplementedError `.
277-
278- .. deprecated :: 3.10
279- Implement :meth: `MetaPathFinder.find_spec ` or
280- :meth: `PathEntryFinder.find_spec ` instead.
281-
282-
283238.. class :: MetaPathFinder
284239
285240 An abstract base class representing a :term: `meta path finder `.
286241
287242 .. versionadded :: 3.3
288243
289244 .. versionchanged :: 3.10
290- No longer a subclass of :class: `Finder `.
245+ No longer a subclass of :class: `! Finder `.
291246
292247 .. method :: find_spec(fullname, path, target=None)
293248
@@ -303,25 +258,6 @@ ABC hierarchy::
303258
304259 .. versionadded :: 3.4
305260
306- .. method :: find_module(fullname, path)
307-
308- A legacy method for finding a :term: `loader ` for the specified
309- module. If this is a top-level import, *path * will be ``None ``.
310- Otherwise, this is a search for a subpackage or module and *path *
311- will be the value of :attr: `__path__ ` from the parent
312- package. If a loader cannot be found, ``None `` is returned.
313-
314- If :meth: `find_spec ` is defined, backwards-compatible functionality is
315- provided.
316-
317- .. versionchanged :: 3.4
318- Returns ``None `` when called instead of raising
319- :exc: `NotImplementedError `. Can use :meth: `find_spec ` to provide
320- functionality.
321-
322- .. deprecated :: 3.4
323- Use :meth: `find_spec ` instead.
324-
325261 .. method :: invalidate_caches()
326262
327263 An optional method which, when called, should invalidate any internal
@@ -342,7 +278,7 @@ ABC hierarchy::
342278 .. versionadded :: 3.3
343279
344280 .. versionchanged :: 3.10
345- No longer a subclass of :class: `Finder `.
281+ No longer a subclass of :class: `! Finder `.
346282
347283 .. method :: find_spec(fullname, target=None)
348284
@@ -356,36 +292,6 @@ ABC hierarchy::
356292
357293 .. versionadded :: 3.4
358294
359- .. method :: find_loader(fullname)
360-
361- A legacy method for finding a :term: `loader ` for the specified
362- module. Returns a 2-tuple of ``(loader, portion) `` where ``portion ``
363- is a sequence of file system locations contributing to part of a namespace
364- package. The loader may be ``None `` while specifying ``portion `` to
365- signify the contribution of the file system locations to a namespace
366- package. An empty list can be used for ``portion `` to signify the loader
367- is not part of a namespace package. If ``loader `` is ``None `` and
368- ``portion `` is the empty list then no loader or location for a namespace
369- package were found (i.e. failure to find anything for the module).
370-
371- If :meth: `find_spec ` is defined then backwards-compatible functionality is
372- provided.
373-
374- .. versionchanged :: 3.4
375- Returns ``(None, []) `` instead of raising :exc: `NotImplementedError `.
376- Uses :meth: `find_spec ` when available to provide functionality.
377-
378- .. deprecated :: 3.4
379- Use :meth: `find_spec ` instead.
380-
381- .. method :: find_module(fullname)
382-
383- A concrete implementation of :meth: `Finder.find_module ` which is
384- equivalent to ``self.find_loader(fullname)[0] ``.
385-
386- .. deprecated :: 3.4
387- Use :meth: `find_spec ` instead.
388-
389295 .. method :: invalidate_caches()
390296
391297 An optional method which, when called, should invalidate any internal
@@ -881,13 +787,6 @@ find and load modules.
881787 is no longer valid then ``None `` is returned but no value is cached
882788 in :data: `sys.path_importer_cache `.
883789
884- .. classmethod :: find_module(fullname, path=None)
885-
886- A legacy wrapper around :meth: `find_spec `.
887-
888- .. deprecated :: 3.4
889- Use :meth: `find_spec ` instead.
890-
891790 .. classmethod :: invalidate_caches()
892791
893792 Calls :meth: `importlib.abc.PathEntryFinder.invalidate_caches ` on all
@@ -938,13 +837,6 @@ find and load modules.
938837
939838 .. versionadded :: 3.4
940839
941- .. method :: find_loader(fullname)
942-
943- Attempt to find the loader to handle *fullname * within :attr: `path `.
944-
945- .. deprecated :: 3.10
946- Use :meth: `find_spec ` instead.
947-
948840 .. method :: invalidate_caches()
949841
950842 Clear out the internal cache.
0 commit comments