Skip to content

Commit

Permalink
Move Sized earlier in the bases of Sequence (#2602)
Browse files Browse the repository at this point in the history
See rominf/ordered-set-stubs#1:
class OrderedSet(MutableSet[T], Sequence[T]): ...
works in Python 3, but not in Python 2 -- this fixes that
  • Loading branch information
gvanrossum authored and JelleZijlstra committed Nov 14, 2018
1 parent 5d85326 commit 4dc21f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/2/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down

0 comments on commit 4dc21f0

Please sign in to comment.