From cdc4de1af49879913683321e7cae1cb8d6489f29 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sun, 1 Nov 2020 22:17:41 +0100 Subject: [PATCH] Derive Reversible from Iterable (#4622) Closes: #4615 --- stdlib/3/typing.pyi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stdlib/3/typing.pyi b/stdlib/3/typing.pyi index 557461633..b99ca7882 100644 --- a/stdlib/3/typing.pyi +++ b/stdlib/3/typing.pyi @@ -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