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.
This commit is contained in:
MonadChains 2022-07-10 20:04:01 +02:00 committed by GitHub
parent ef61b259e3
commit e8e4b550f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View 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`` | | | |
+----------------------------------+---------------+-------------------+----------------+