Skip to content

Commit

Permalink
inherit collection and reversible directly
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Oct 11, 2024
1 parent 4ffecce commit 298fd73
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ from _typeshed import (
SupportsRichComparisonT,
SupportsWrite,
)
from abc import abstractmethod
from collections.abc import Awaitable, Callable, Iterable, Iterator, MutableSet, Reversible, Set as AbstractSet, Sized
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
from types import CellType, CodeType, TracebackType
Expand Down Expand Up @@ -835,20 +834,8 @@ _IntegerFormats: TypeAlias = Literal[
"b", "B", "@b", "@B", "h", "H", "@h", "@H", "i", "I", "@i", "@I", "l", "L", "@l", "@L", "q", "Q", "@q", "@Q", "P", "@P"
]

# Sequence[T] without index and count
class __memory_view(Collection[_T_co], Reversible[_T_co]):
@overload
@abstractmethod
def __getitem__(self, index: int) -> _T_co: ...
@overload
@abstractmethod
def __getitem__(self, index: slice) -> __memory_view[_T_co]: ...
def __contains__(self, value: object) -> bool: ...
def __iter__(self) -> Iterator[_T_co]: ...
def __reversed__(self) -> Iterator[_T_co]: ...

@final
class memoryview(__memory_view[_I]):
class memoryview(Collection[_T_co], Reversible[_T_co]):
@property
def format(self) -> str: ...
@property
Expand Down

0 comments on commit 298fd73

Please sign in to comment.