Skip to content

Commit e8e4b55

Browse files
authored
pythongh-94309: Deprecate typing.Hashable/Sized (pythonGH-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.
1 parent ef61b25 commit e8e4b55

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Doc/library/typing.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,6 +2215,9 @@ Corresponding to other types in :mod:`collections.abc`
22152215

22162216
An alias to :class:`collections.abc.Hashable`.
22172217

2218+
.. deprecated:: 3.12
2219+
Use :class:`collections.abc.Hashable` directly instead.
2220+
22182221
.. class:: Reversible(Iterable[T_co])
22192222

22202223
A generic version of :class:`collections.abc.Reversible`.
@@ -2227,6 +2230,9 @@ Corresponding to other types in :mod:`collections.abc`
22272230

22282231
An alias to :class:`collections.abc.Sized`.
22292232

2233+
.. deprecated:: 3.12
2234+
Use :class:`collections.abc.Sized` directly instead.
2235+
22302236
Asynchronous programming
22312237
""""""""""""""""""""""""
22322238

@@ -2849,3 +2855,6 @@ convenience. This is subject to change, and not all deprecations are listed.
28492855
+----------------------------------+---------------+-------------------+----------------+
28502856
| ``typing.Text`` | 3.11 | Undecided | :gh:`92332` |
28512857
+----------------------------------+---------------+-------------------+----------------+
2858+
| ``typing.Hashable`` and | 3.12 | Undecided | :gh:`94309` |
2859+
| ``typing.Sized`` | | | |
2860+
+----------------------------------+---------------+-------------------+----------------+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecate aliases :class:`typing.Hashable` and :class:`typing.Sized`

0 commit comments

Comments
 (0)