From: MonadChains Date: Sun, 10 Jul 2022 18:04:01 +0000 (+0200) Subject: gh-94309: Deprecate typing.Hashable/Sized (GH-94626) X-Git-Tag: v3.12.0a1~983 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e8e4b550f50e716c57cc5d0225042ab766c5582d;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index fceb43aec9be..3980e45ed683 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 000000000000..b1d45586e9c4 --- /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`