Skip to content

Commit 4ad291f

Browse files
committed
Attempt to clarify the ByteString situation
See python/cpython#102092 This makes the behaviour of typing.ByteString better match its documentation. I also remove collections.abc.ByteString. There is no legitimate use case for it. Let me know if you think there's a case where it would help users to have this around.
1 parent 1db405b commit 4ad291f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

stdlib/_collections_abc.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ from typing import ( # noqa: Y022,Y038
66
AsyncIterable as AsyncIterable,
77
AsyncIterator as AsyncIterator,
88
Awaitable as Awaitable,
9-
ByteString as ByteString,
109
Callable as Callable,
1110
Collection as Collection,
1211
Container as Container,

stdlib/typing.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ class TextIO(IO[str]):
715715
@abstractmethod
716716
def __enter__(self) -> TextIO: ...
717717

718-
class ByteString(Sequence[int], metaclass=ABCMeta): ...
718+
ByteString = bytes | bytearray | memoryview
719719

720720
# Functions
721721

0 commit comments

Comments
 (0)