Added Optional[] around the itertools.groupby() key attribute to allow None to pass the type (#2790)

Fixes #2788
This commit is contained in:
Alun Champion
2019-02-12 04:59:37 -06:00
committed by Sebastian Rittau
parent ca62cecd14
commit 9b545a01ab
2 changed files with 2 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ def filterfalse(predicate: Optional[Predicate[_T]],
def groupby(iterable: Iterable[_T]) -> Iterator[Tuple[_T, Iterator[_T]]]: ...
@overload
def groupby(iterable: Iterable[_T],
key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ...
key: Optional[Callable[[_T], _S]]) -> Iterator[Tuple[_S, Iterator[_T]]]: ...
@overload
def islice(iterable: Iterable[_T], stop: Optional[int]) -> Iterator[_T]: ...