mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 12:21:27 +08:00
Iterator provides a concrete __iter__ in 2.7 (#2245)
This is already how it works in the Python 3 stub. `Iterator.__iter__` also exists at runtime: https://github.com/python/cpython/blob/2.7/Lib/_abcoll.py#L73.
This commit is contained in:
committed by
Ivan Levkivskyi
parent
0393de4bd7
commit
6b36b1befe
@@ -118,6 +118,7 @@ class Iterable(Protocol[_T_co]):
|
||||
class Iterator(Iterable[_T_co], Protocol[_T_co]):
|
||||
@abstractmethod
|
||||
def next(self) -> _T_co: ...
|
||||
def __iter__(self) -> Iterator[_T_co]: ...
|
||||
|
||||
class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
|
||||
@abstractmethod
|
||||
|
||||
Reference in New Issue
Block a user