mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Make func in builtin map optional in Python 2 (#1751)
* Make `func` in builtin `map` optional in Python 2 * Add `map` overloads with `None` `func` in Python 2
This commit is contained in:
committed by
Jelle Zijlstra
parent
622e744f3e
commit
b0d9752a1c
@@ -732,6 +732,12 @@ def map(func: Callable[[_T1, _T2], _S],
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2]) -> List[_S]: ... # TODO more than two iterables
|
||||
@overload
|
||||
def map(func: None, iter1: Iterable[_T1]) -> List[_T1]: ...
|
||||
@overload
|
||||
def map(func: None,
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... # TODO more than two iterables
|
||||
@overload
|
||||
def max(arg1: _T, arg2: _T, *args: _T, key: Callable[[_T], Any] = ...) -> _T: ...
|
||||
@overload
|
||||
def max(iterable: Iterable[_T], key: Callable[[_T], Any] = ...) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user