]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-94309: Deprecate typing.Hashable/Sized (GH-94626)
authorMonadChains <monadchains@gmail.com>
Sun, 10 Jul 2022 18:04:01 +0000 (20:04 +0200)
committerGitHub <noreply@github.com>
Sun, 10 Jul 2022 18:04:01 +0000 (19:04 +0100)
Deprecate typing.Hashable/Sized. Use the collections.abc counterparts directly instead.

To be consistent with PEP 585, deprecated aliases will not raise any DeprecationWarning.

Doc/library/typing.rst
Misc/NEWS.d/next/Library/2022-07-06-22-41-51.gh-issue-94309._XswsX.rst [new file with mode: 0644]

index fceb43aec9be378cdca06b487c110747cc94f4c2..3980e45ed6832474e23e2caaea265e2c5329d35a 100644 (file)
@@ -2215,6 +2215,9 @@ Corresponding to other types in :mod:`collections.abc`
 
    An alias to :class:`collections.abc.Hashable`.
 
+   .. deprecated:: 3.12
+      Use :class:`collections.abc.Hashable` directly instead.
+
 .. class:: Reversible(Iterable[T_co])
 
    A generic version of :class:`collections.abc.Reversible`.
@@ -2227,6 +2230,9 @@ Corresponding to other types in :mod:`collections.abc`
 
    An alias to :class:`collections.abc.Sized`.
 
+   .. deprecated:: 3.12
+      Use :class:`collections.abc.Sized` directly instead.
+
 Asynchronous programming
 """"""""""""""""""""""""
 
@@ -2849,3 +2855,6 @@ convenience. This is subject to change, and not all deprecations are listed.
 +----------------------------------+---------------+-------------------+----------------+
 |  ``typing.Text``                 | 3.11          | Undecided         | :gh:`92332`    |
 +----------------------------------+---------------+-------------------+----------------+
+|  ``typing.Hashable`` and         | 3.12          | Undecided         | :gh:`94309`    |
+|  ``typing.Sized``                |               |                   |                |
++----------------------------------+---------------+-------------------+----------------+
diff --git a/Misc/NEWS.d/next/Library/2022-07-06-22-41-51.gh-issue-94309._XswsX.rst b/Misc/NEWS.d/next/Library/2022-07-06-22-41-51.gh-issue-94309._XswsX.rst
new file mode 100644 (file)
index 0000000..b1d4558
--- /dev/null
@@ -0,0 +1 @@
+Deprecate aliases :class:`typing.Hashable` and :class:`typing.Sized`