builtins: improve bytes handling (#9027)

This commit is contained in:
Jelle Zijlstra
2022-10-30 17:32:07 -07:00
committed by GitHub
parent 6569deaa44
commit c347c29417

View File

@@ -677,7 +677,7 @@ class bytes(ByteString):
def __rmul__(self, __n: SupportsIndex) -> bytes: ...
def __mod__(self, __value: Any) -> bytes: ...
# Incompatible with Sequence.__contains__
def __contains__(self, __o: SupportsIndex | bytes) -> bool: ... # type: ignore[override]
def __contains__(self, __o: SupportsIndex | ReadableBuffer) -> bool: ... # type: ignore[override]
def __eq__(self, __x: object) -> bool: ...
def __ne__(self, __x: object) -> bool: ...
def __lt__(self, __x: bytes) -> bool: ...
@@ -798,10 +798,10 @@ class bytearray(MutableSequence[int], ByteString):
def __contains__(self, __o: SupportsIndex | ReadableBuffer) -> bool: ... # type: ignore[override]
def __eq__(self, __x: object) -> bool: ...
def __ne__(self, __x: object) -> bool: ...
def __lt__(self, __x: bytes) -> bool: ...
def __le__(self, __x: bytes) -> bool: ...
def __gt__(self, __x: bytes) -> bool: ...
def __ge__(self, __x: bytes) -> bool: ...
def __lt__(self, __x: ReadableBuffer) -> bool: ...
def __le__(self, __x: ReadableBuffer) -> bool: ...
def __gt__(self, __x: ReadableBuffer) -> bool: ...
def __ge__(self, __x: ReadableBuffer) -> bool: ...
def __alloc__(self) -> int: ...
@final
@@ -821,7 +821,7 @@ class memoryview(Sequence[int]):
@property
def ndim(self) -> int: ...
@property
def obj(self) -> bytes | bytearray: ...
def obj(self) -> ReadableBuffer: ...
@property
def c_contiguous(self) -> bool: ...
@property