@@ -954,11 +954,15 @@ class memoryview(Sequence[_I]):
954954 def hex (self , sep : str | bytes = ..., bytes_per_sep : SupportsIndex = 1 ) -> str : ...
955955 def __buffer__ (self , flags : int , / ) -> memoryview : ...
956956 def __release_buffer__ (self , buffer : memoryview , / ) -> None : ...
957+ if sys .version_info >= (3 , 14 ):
958+ def index (self , value : object , start : SupportsIndex = 0 , stop : SupportsIndex = sys .maxsize , / ) -> int : ...
959+ def count (self , value : object , / ) -> int : ...
960+ else :
961+ # These are inherited from the Sequence ABC, but don't actually exist on memoryview.
962+ # See https://github.com/python/cpython/issues/125420
963+ index : ClassVar [None ] # type: ignore[assignment]
964+ count : ClassVar [None ] # type: ignore[assignment]
957965
958- # These are inherited from the Sequence ABC, but don't actually exist on memoryview.
959- # See https://github.com/python/cpython/issues/125420
960- index : ClassVar [None ] # type: ignore[assignment]
961- count : ClassVar [None ] # type: ignore[assignment]
962966 if sys .version_info >= (3 , 14 ):
963967 def __class_getitem__ (cls , item : Any , / ) -> GenericAlias : ...
964968
0 commit comments