From e8e4b550f50e716c57cc5d0225042ab766c5582d Mon Sep 17 00:00:00 2001 From: MonadChains Date: Sun, 10 Jul 2022 20:04:01 +0200 Subject: gh-94309: Deprecate typing.Hashable/Sized (GH-94626) 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 | 9 +++++++++ .../next/Library/2022-07-06-22-41-51.gh-issue-94309._XswsX.rst | 1 + 2 files changed, 10 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2022-07-06-22-41-51.gh-issue-94309._XswsX.rst diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index fceb43a..3980e45 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -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 index 0000000..b1d4558 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-07-06-22-41-51.gh-issue-94309._XswsX.rst @@ -0,0 +1 @@ +Deprecate aliases :class:`typing.Hashable` and :class:`typing.Sized` -- cgit v0.12