File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
@tests/test_cases/builtins Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 56
56
# An invalid literal should raise an error.
57
57
mv = memoryview (b"abc" )
58
58
mv .cast ("abc" ) # type: ignore
59
+
60
+ mv .index (42 ) # type: ignore
61
+ mv .count (42 ) # type: ignore
Original file line number Diff line number Diff line change @@ -834,7 +834,7 @@ _IntegerFormats: TypeAlias = Literal[
834
834
]
835
835
836
836
@final
837
- class memoryview (Generic [_I ]):
837
+ class memoryview (Sequence [_I ]):
838
838
@property
839
839
def format (self ) -> str : ...
840
840
@property
@@ -897,6 +897,11 @@ class memoryview(Generic[_I]):
897
897
def __buffer__ (self , flags : int , / ) -> memoryview : ...
898
898
def __release_buffer__ (self , buffer : memoryview , / ) -> None : ...
899
899
900
+ # These are inherited from the Sequence ABC, but don't actually exist on memoryview.
901
+ # See https://github.com/python/cpython/issues/125420
902
+ index : ClassVar [None ] # type: ignore[assignment]
903
+ count : ClassVar [None ] # type: ignore[assignment]
904
+
900
905
@final
901
906
class bool (int ):
902
907
def __new__ (cls , o : object = ..., / ) -> Self : ...
You can’t perform that action at this time.
0 commit comments