mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Implement itertools.chain.from_iterable().
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# Based on http://docs.python.org/3.2/library/itertools.html
|
||||
|
||||
from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple,
|
||||
Union, Sequence)
|
||||
Union, Sequence, Generic)
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_S = TypeVar('_S')
|
||||
@@ -18,8 +18,12 @@ def repeat(object: _T) -> Iterator[_T]: ...
|
||||
def repeat(object: _T, times: int) -> Iterator[_T]: ...
|
||||
|
||||
def accumulate(iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
def chain(*iterables: Iterable[_T]) -> Iterator[_T]: ...
|
||||
# TODO chain.from_Iterable
|
||||
|
||||
class chain(Iterator[_T], Generic[_T]):
|
||||
def __init__(self, *iterables: Iterable[_T]) -> None: ...
|
||||
@staticmethod
|
||||
def from_iterable(iterable: Iterable[Iterable[_T]]) -> Iterator[_T]: ...
|
||||
|
||||
def compress(data: Iterable[_T], selectors: Iterable[Any]) -> Iterator[_T]: ...
|
||||
def dropwhile(predicate: Callable[[_T], Any],
|
||||
iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
|
||||
Reference in New Issue
Block a user