[stdlib] memoryview updates for version 3.14 (#15102)

This commit is contained in:
Guo Ci
2025-12-11 06:40:25 -05:00
committed by GitHub
parent d9f078f618
commit f1359a6c84
2 changed files with 15 additions and 6 deletions
+8 -4
View File
@@ -954,11 +954,15 @@ class memoryview(Sequence[_I]):
def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = 1) -> str: ...
def __buffer__(self, flags: int, /) -> memoryview: ...
def __release_buffer__(self, buffer: memoryview, /) -> None: ...
if sys.version_info >= (3, 14):
def index(self, value: object, start: SupportsIndex = 0, stop: SupportsIndex = sys.maxsize, /) -> int: ...
def count(self, value: object, /) -> int: ...
else:
# These are inherited from the Sequence ABC, but don't actually exist on memoryview.
# See https://github.com/python/cpython/issues/125420
index: ClassVar[None] # type: ignore[assignment]
count: ClassVar[None] # type: ignore[assignment]
# These are inherited from the Sequence ABC, but don't actually exist on memoryview.
# See https://github.com/python/cpython/issues/125420
index: ClassVar[None] # type: ignore[assignment]
count: ClassVar[None] # type: ignore[assignment]
if sys.version_info >= (3, 14):
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...