Derive Reversible from Iterable (#4622)

Closes: #4615
This commit is contained in:
Sebastian Rittau
2020-11-01 22:17:41 +01:00
committed by GitHub
parent f7a236cfc0
commit cdc4de1af4

View File

@@ -148,11 +148,6 @@ class SupportsRound(Protocol[_T_co]):
@abstractmethod
def __round__(self, ndigits: int) -> _T_co: ...
@runtime_checkable
class Reversible(Protocol[_T_co]):
@abstractmethod
def __reversed__(self) -> Iterator[_T_co]: ...
@runtime_checkable
class Sized(Protocol, metaclass=ABCMeta):
@abstractmethod
@@ -179,6 +174,11 @@ class Iterator(Iterable[_T_co], Protocol[_T_co]):
def __next__(self) -> _T_co: ...
def __iter__(self) -> Iterator[_T_co]: ...
@runtime_checkable
class Reversible(Iterable[_T_co], Protocol[_T_co]):
@abstractmethod
def __reversed__(self) -> Iterator[_T_co]: ...
class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
def __next__(self) -> _T_co: ...
@abstractmethod