Skip to content

Commit b299486

Browse files
committed
pythongh-91896: Add abstract methods to collections.abc.ByteString
1 parent 4403320 commit b299486

File tree

4 files changed

+443
-6
lines changed

4 files changed

+443
-6
lines changed

Diff for: Doc/library/collections.abc.rst

+11-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ ABC Inherits from Abstract Methods Mi
142142
``insert``
143143

144144
:class:`ByteString` :class:`Sequence` ``__getitem__``, Inherited :class:`Sequence` methods
145-
``__len__``
145+
``__len__``,
146+
many others
146147

147148
:class:`Set` :class:`Collection` ``__contains__``, ``__le__``, ``__lt__``, ``__eq__``, ``__ne__``,
148149
``__iter__``, ``__gt__``, ``__ge__``, ``__and__``, ``__or__``,
@@ -255,7 +256,6 @@ Collections Abstract Base Classes -- Detailed Descriptions
255256

256257
.. class:: Sequence
257258
MutableSequence
258-
ByteString
259259

260260
ABCs for read-only and mutable :term:`sequences <sequence>`.
261261

@@ -272,6 +272,15 @@ Collections Abstract Base Classes -- Detailed Descriptions
272272
The index() method added support for *stop* and *start*
273273
arguments.
274274

275+
.. class:: ByteString
276+
277+
An ABC that provides the shared interface for :class:`bytes`
278+
and :class:`bytearray`. It includes abstract methods for the
279+
approximately 50 methods shared by the two types.
280+
281+
.. versionchanged:: 3.11
282+
Previously, this ABC did not define any methods.
283+
275284
.. class:: Set
276285
MutableSet
277286

0 commit comments

Comments
 (0)