Skip to content

Commit

Permalink
pythongh-102500: Remove mention of bytes shorthand (python#104281)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
hauntsaninja authored May 8, 2023
1 parent c2683fc commit 1f56795
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2130,15 +2130,10 @@ Corresponding to collections in :mod:`collections.abc`

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

A generic version of :class:`collections.abc.ByteString`.

This type represents the types :class:`bytes`, :class:`bytearray`,
and :class:`memoryview` of byte sequences.

As a shorthand for this type, :class:`bytes` can be used to
annotate arguments of any of the types mentioned above.

.. deprecated:: 3.9
.. deprecated-removed:: 3.9 3.14
Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray | memoryview``.

.. class:: Collection(Sized, Iterable[T_co], Container[T_co])
Expand Down Expand Up @@ -2977,6 +2972,8 @@ convenience. This is subject to change, and not all deprecations are listed.
| ``typing`` versions of standard | 3.9 | Undecided | :pep:`585` |
| collections | | | |
+----------------------------------+---------------+-------------------+----------------+
| ``typing.ByteString`` | 3.9 | 3.14 | :gh:`91896` |
+----------------------------------+---------------+-------------------+----------------+
| ``typing.Text`` | 3.11 | Undecided | :gh:`92332` |
+----------------------------------+---------------+-------------------+----------------+
| ``typing.Hashable`` and | 3.12 | Undecided | :gh:`94309` |
Expand Down

0 comments on commit 1f56795

Please sign in to comment.