mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
memoryview: re-add inheritance from Sequence, set index and count to None (#12800)
This reverts commit f625e92ae5.
This commit is contained in:
@@ -834,7 +834,7 @@ _IntegerFormats: TypeAlias = Literal[
|
||||
]
|
||||
|
||||
@final
|
||||
class memoryview(Generic[_I]):
|
||||
class memoryview(Sequence[_I]):
|
||||
@property
|
||||
def format(self) -> str: ...
|
||||
@property
|
||||
@@ -897,6 +897,11 @@ class memoryview(Generic[_I]):
|
||||
def __buffer__(self, flags: int, /) -> memoryview: ...
|
||||
def __release_buffer__(self, buffer: memoryview, /) -> None: ...
|
||||
|
||||
# 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]
|
||||
|
||||
@final
|
||||
class bool(int):
|
||||
def __new__(cls, o: object = ..., /) -> Self: ...
|
||||
|
||||
Reference in New Issue
Block a user