From f3b499fd992914a31a16f2a215e53ced07dd0314 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Mon, 21 Dec 2015 18:11:14 -0800 Subject: [PATCH] typing: update 2 to match 3 on Sequence and Container --- stdlib/2.7/typing.pyi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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