diff --git a/builtins/2.7/__builtin__.pyi b/builtins/2.7/__builtin__.pyi index cbb94f998..12e36a12a 100644 --- a/builtins/2.7/__builtin__.pyi +++ b/builtins/2.7/__builtin__.pyi @@ -464,7 +464,7 @@ class function: __name__ = ... # type: str __module__ = ... # type: str -class list(MutableSequence[_T], Reversible[_T], Generic[_T]): +class list(MutableSequence[_T], Generic[_T]): @overload def __init__(self) -> None: ... @overload diff --git a/builtins/3/builtins.pyi b/builtins/3/builtins.pyi index c043eb170..91356e35d 100644 --- a/builtins/3/builtins.pyi +++ b/builtins/3/builtins.pyi @@ -438,7 +438,7 @@ class function: __module__ = ... # type: str __code__ = ... # type: Any -class list(MutableSequence[_T], Reversible[_T], Generic[_T]): +class list(MutableSequence[_T], Generic[_T]): @overload def __init__(self) -> None: ... @overload @@ -578,7 +578,7 @@ class enumerate(Iterator[Tuple[int, _T]], Generic[_T]): def __next__(self) -> Tuple[int, _T]: ... # TODO __getattribute__ -class range(Sequence[int], Reversible[int]): +class range(Sequence[int]): @overload def __init__(self, stop: int) -> None: ... @overload diff --git a/stdlib/2.7/typing.pyi b/stdlib/2.7/typing.pyi index 75c492aac..c5cc78fde 100644 --- a/stdlib/2.7/typing.pyi +++ b/stdlib/2.7/typing.pyi @@ -78,19 +78,23 @@ class Iterator(Iterable[_T_co], Generic[_T_co]): @abstractmethod def next(self) -> _T_co: ... -class Sequence(Sized, Iterable[_T_co], Generic[_T_co]): +class Container(Generic[_T_co]): @abstractmethod def __contains__(self, x: object) -> bool: ... + +class Sequence(Iterable[_T_co], Container[_T_co], Sized, Reversible[_T_co], Generic[_T_co]): @overload @abstractmethod def __getitem__(self, i: int) -> _T_co: ... @overload @abstractmethod def __getitem__(self, s: slice) -> Sequence[_T_co]: ... - @abstractmethod + # Mixin methods def index(self, x: Any) -> int: ... - @abstractmethod def count(self, x: Any) -> int: ... + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __reversed__(self) -> Iterator[_T_co]: ... class MutableSequence(Sequence[_T], Generic[_T]): @abstractmethod