bpo-42135: Deprecate implementations of find_module() and find_loader() (GH-25169)
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index 6515cdb..50297e0 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -257,6 +257,10 @@
Returns ``None`` when called instead of raising
:exc:`NotImplementedError`.
+ .. deprecated:: 3.10
+ Implement :meth:`MetaPathFinder.find_spec` or
+ :meth:`PathEntryFinder.find_spec` instead.
+
.. class:: MetaPathFinder
@@ -265,6 +269,9 @@
.. versionadded:: 3.3
+ .. versionchanged:: 3.10
+ No longer a subclass of :class:`Finder`.
+
.. method:: find_spec(fullname, path, target=None)
An abstract method for finding a :term:`spec <module spec>` for
@@ -313,11 +320,13 @@
An abstract base class representing a :term:`path entry finder`. Though
it bears some similarities to :class:`MetaPathFinder`, ``PathEntryFinder``
is meant for use only within the path-based import subsystem provided
- by :class:`PathFinder`. This ABC is a subclass of :class:`Finder` for
- compatibility reasons only.
+ by :class:`importlib.machinery.PathFinder`.
.. versionadded:: 3.3
+ .. versionchanged:: 3.10
+ No longer a subclass of :class:`Finder`.
+
.. method:: find_spec(fullname, target=None)
An abstract method for finding a :term:`spec <module spec>` for
@@ -363,7 +372,8 @@
.. method:: invalidate_caches()
An optional method which, when called, should invalidate any internal
- cache used by the finder. Used by :meth:`PathFinder.invalidate_caches`
+ cache used by the finder. Used by
+ :meth:`importlib.machinery.PathFinder.invalidate_caches`
when invalidating the caches of all cached finders.
@@ -1193,6 +1203,9 @@
Attempt to find the loader to handle *fullname* within :attr:`path`.
+ .. deprecated:: 3.10
+ Use :meth:`find_spec` instead.
+
.. method:: invalidate_caches()
Clear out the internal cache.