Move Sized earlier in the bases of Sequence (#2602)

See https://github.com/rominf/ordered-set-stubs/issues/1:
class OrderedSet(MutableSet[T], Sequence[T]): ...
works in Python 3, but not in Python 2 -- this fixes that
This commit is contained in:
Guido van Rossum
2018-11-13 20:47:48 -08:00
committed by Jelle Zijlstra
parent 5d85326ad8
commit 4dc21f04dd

View File

@@ -144,7 +144,7 @@ class Container(Protocol[_T_co]):
@abstractmethod
def __contains__(self, x: object) -> bool: ...
class Sequence(Iterable[_T_co], Container[_T_co], Sized, Reversible[_T_co], Generic[_T_co]):
class Sequence(Sized, Iterable[_T_co], Container[_T_co], Reversible[_T_co], Generic[_T_co]):
@overload
@abstractmethod
def __getitem__(self, i: int) -> _T_co: ...