mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Overload the reduce function
This commit is contained in:
@@ -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', [
|
||||
|
||||
Reference in New Issue
Block a user