Overload the reduce function

This commit is contained in:
Sidharth Kapur
2016-02-20 22:46:39 -06:00
parent b0c0f94210
commit fd9310fa97

View File

@@ -10,8 +10,12 @@ _AnyCallable = Callable[..., Any]
_T = TypeVar("_T")
_S = TypeVar("_S")
@overload
def reduce(function: Callable[[_T, _S], _T],
sequence: Iterator[_S], initial: Optional[_T] = ...) -> _T: ...
sequence: Iterator[_S], initial: _T) -> _T: ...
@overload
def reduce(function: Callable[[_T, _T], _T],
sequence: Iterator[_T]) -> _T: ...
class CacheInfo(NamedTuple('CacheInfo', [