Skip to content

Commit 4d49df3

Browse files
hauntsaninjaAlexWaygood
authored andcommitted
pythongh-102500: Remove mention of bytes shorthand (python#104281)
The bytes shorthand was removed in PEP 688: https://peps.python.org/pep-0688/#no-special-meaning-for-bytes I also remove the reference to `collections.abc.ByteString`, since that object is deprecated (python#91896) and has different semantics (python#102092)
1 parent 065e2ae commit 4d49df3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Doc/library/typing.rst

+4-8
Original file line numberDiff line numberDiff line change
@@ -2090,17 +2090,11 @@ Corresponding to collections in :mod:`collections.abc`
20902090

20912091
.. class:: ByteString(Sequence[int])
20922092

2093-
A generic version of :class:`collections.abc.ByteString`.
2094-
20952093
This type represents the types :class:`bytes`, :class:`bytearray`,
20962094
and :class:`memoryview` of byte sequences.
20972095

2098-
As a shorthand for this type, :class:`bytes` can be used to
2099-
annotate arguments of any of the types mentioned above.
2100-
2101-
.. deprecated:: 3.9
2102-
:class:`collections.abc.ByteString` now supports subscripting (``[]``).
2103-
See :pep:`585` and :ref:`types-genericalias`.
2096+
.. deprecated-removed:: 3.9 3.14
2097+
Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray | memoryview``.
21042098

21052099
.. class:: Collection(Sized, Iterable[T_co], Container[T_co])
21062100

@@ -2892,5 +2886,7 @@ convenience. This is subject to change, and not all deprecations are listed.
28922886
| ``typing`` versions of standard | 3.9 | Undecided | :pep:`585` |
28932887
| collections | | | |
28942888
+----------------------------------+---------------+-------------------+----------------+
2889+
| ``typing.ByteString`` | 3.9 | 3.14 | :gh:`91896` |
2890+
+----------------------------------+---------------+-------------------+----------------+
28952891
| ``typing.Text`` | 3.11 | Undecided | :gh:`92332` |
28962892
+----------------------------------+---------------+-------------------+----------------+

0 commit comments

Comments
 (0)