[Python-checkins] gh-93963: Document importlib.abc deprecations (#94546)

ambv webhook-mailer at python.org
Mon Jul 25 12:24:51 EDT 2022


https://github.com/python/cpython/commit/10b12dd92ab6e29b573706dd6adb3d8eb63ae81b
commit: 10b12dd92ab6e29b573706dd6adb3d8eb63ae81b
branch: main
author: Hugo van Kemenade <hugovk at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2022-07-25T18:24:42+02:00
summary:

gh-93963: Document importlib.abc deprecations (#94546)

files:
M Doc/library/importlib.resources.abc.rst
M Doc/whatsnew/3.12.rst

diff --git a/Doc/library/importlib.resources.abc.rst b/Doc/library/importlib.resources.abc.rst
index d281ac032216a..57fffe0d905cb 100644
--- a/Doc/library/importlib.resources.abc.rst
+++ b/Doc/library/importlib.resources.abc.rst
@@ -45,6 +45,9 @@
 
     .. versionadded:: 3.7
 
+    .. deprecated-removed:: 3.12 3.14
+       Use :class:`importlib.resources.abc.TraversableResources` instead.
+
     .. abstractmethod:: open_resource(resource)
 
         Returns an opened, :term:`file-like object` for binary reading
@@ -91,6 +94,9 @@
 
     .. versionadded:: 3.9
 
+    .. deprecated-removed:: 3.12 3.14
+       Use :class:`importlib.resources.abc.Traversable` instead.
+
     .. attribute:: name
 
        Abstract. The base name of this object without any parent references.
@@ -146,6 +152,9 @@
 
     .. versionadded:: 3.9
 
+    .. deprecated-removed:: 3.12 3.14
+       Use :class:`importlib.resources.abc.TraversableResources` instead.
+
     .. abstractmethod:: files()
 
        Returns a :class:`importlib.resources.abc.Traversable` object for the loaded
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst
index 4a37e282b2a79..03020559362b1 100644
--- a/Doc/whatsnew/3.12.rst
+++ b/Doc/whatsnew/3.12.rst
@@ -180,6 +180,24 @@ APIs:
 * :func:`unittest.getTestCaseNames` (:gh:`50096`)
 * :class:`webbrowser.MacOSX` (:gh:`86421`)
 
+Pending Removal in Python 3.14
+==============================
+
+* Deprecated the following :mod:`importlib.abc` classes, scheduled for removal in
+  Python 3.14:
+
+  * :class:`importlib.abc.ResourceReader`
+  * :class:`importlib.abc.Traversable`
+  * :class:`importlib.abc.TraversableResources`
+
+  Use :mod:`importlib.resources.abc` classes instead:
+
+  * :class:`importlib.resources.abc.TraversableResources`
+  * :class:`importlib.resources.abc.Traversable`
+  * :class:`importlib.resources.abc.TraversableResources`
+
+  (Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)
+
 Pending Removal in Future Versions
 ----------------------------------
 



More information about the Python-checkins mailing list