From c893857f4671e454d558c3fcaf1a502548669873 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Thu, 14 Jan 2021 12:07:14 -0800 Subject: [PATCH] itertools: fix signature of accumulate (#4933) Resolves #4888 --- stdlib/3/itertools.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/3/itertools.pyi b/stdlib/3/itertools.pyi index 59bd40b83..ddefb5af4 100644 --- a/stdlib/3/itertools.pyi +++ b/stdlib/3/itertools.pyi @@ -21,12 +21,12 @@ def repeat(object: _T, times: int) -> Iterator[_T]: ... if sys.version_info >= (3, 8): @overload - def accumulate(iterable: Iterable[_T], func: Callable[[_T, _T], _T] = ...) -> Iterator[_T]: ... + def accumulate(iterable: Iterable[_T], func: None = ..., *, initial: Optional[_T] = ...) -> Iterator[_T]: ... @overload - def accumulate(iterable: Iterable[_T], func: Callable[[_S, _T], _S], initial: Optional[_S]) -> Iterator[_S]: ... + def accumulate(iterable: Iterable[_T], func: Callable[[_S, _T], _S], *, initial: Optional[_S] = ...) -> Iterator[_S]: ... else: - def accumulate(iterable: Iterable[_T], func: Callable[[_T, _T], _T] = ...) -> Iterator[_T]: ... + def accumulate(iterable: Iterable[_T], func: Optional[Callable[[_T, _T], _T]] = ...) -> Iterator[_T]: ... class chain(Iterator[_T], Generic[_T]): def __init__(self, *iterables: Iterable[_T]) -> None: ...