typing: update 2 to match 3 on Sequence and Container

This commit is contained in:
Greg Price
2015-12-21 18:11:14 -08:00
parent c0493bd3d0
commit f3b499fd99

View File

@@ -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