mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Make itertools.cycle a type (#3732)
This commit is contained in:
@@ -10,7 +10,11 @@ _S = TypeVar('_S')
|
||||
|
||||
def count(start: int = ...,
|
||||
step: int = ...) -> Iterator[int]: ... # more general types?
|
||||
def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
|
||||
class cycle(Iterator[_T], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T]) -> None: ...
|
||||
def next(self) -> _T: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
|
||||
def repeat(object: _T, times: int = ...) -> Iterator[_T]: ...
|
||||
|
||||
|
||||
@@ -13,7 +13,11 @@ Predicate = Callable[[_T], object]
|
||||
|
||||
def count(start: _N = ...,
|
||||
step: _N = ...) -> Iterator[_N]: ... # more general types?
|
||||
def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
|
||||
class cycle(Iterator[_T], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T]) -> None: ...
|
||||
def __next__(self) -> _T: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
|
||||
@overload
|
||||
def repeat(object: _T) -> Iterator[_T]: ...
|
||||
|
||||
Reference in New Issue
Block a user