mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
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:
committed by
Jelle Zijlstra
parent
5d85326ad8
commit
4dc21f04dd
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user