mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Make islice start and stop parameters optional (#2031)
From the documentation [1]: "If start is None, then iteration starts at zero." [1] https://docs.python.org/3/library/itertools.html#itertools.islice. PR #1603 made this change for Python 2.
This commit is contained in:
committed by
Jelle Zijlstra
parent
a51b480609
commit
6c1dffed58
@@ -38,7 +38,7 @@ def groupby(iterable: Iterable[_T],
|
||||
key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ...
|
||||
|
||||
@overload
|
||||
def islice(iterable: Iterable[_T], stop: int) -> Iterator[_T]: ...
|
||||
def islice(iterable: Iterable[_T], stop: Optional[int]) -> Iterator[_T]: ...
|
||||
@overload
|
||||
def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int],
|
||||
step: int = ...) -> Iterator[_T]: ...
|
||||
|
||||
@@ -40,9 +40,9 @@ def groupby(iterable: Iterable[_T],
|
||||
key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ...
|
||||
|
||||
@overload
|
||||
def islice(iterable: Iterable[_T], stop: int) -> Iterator[_T]: ...
|
||||
def islice(iterable: Iterable[_T], stop: Optional[int]) -> Iterator[_T]: ...
|
||||
@overload
|
||||
def islice(iterable: Iterable[_T], start: int, stop: Optional[int],
|
||||
def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int],
|
||||
step: int = ...) -> Iterator[_T]: ...
|
||||
|
||||
def starmap(func: Callable[..., _S], iterable: Iterable[Iterable[Any]]) -> Iterator[_S]: ...
|
||||
|
||||
Reference in New Issue
Block a user