Add overloads for min/max that don't take default (#2885)

PR #2833 introduced more flexible handling for the type of the default
parameter, but the extra type variable caused some issues. Add another
overload for the case where there is no default param.

This is I think related to the issues we have had with `get` recently?
This commit is contained in:
Michael J. Sullivan authored and GitHub committed 2019-03-25 15:38:21 -07:00
1 parent 7646506c14
commit c526975a1b
2 files changed
+12 -4

No files matched your search

+6 -2
View File
@@ -1284,7 +1284,9 @@ if sys.version_info >= (3,):
@overload
def max(_arg1: _T, _arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ...
@overload
def max(_iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT = ...) -> Union[_T, _VT]: ...
def max(_iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ...
@overload
def max(_iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ...
else:
@overload
def max(_arg1: _T, _arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ...
@@ -1294,7 +1296,9 @@ if sys.version_info >= (3,):
@overload
def min(_arg1: _T, _arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ...
@overload
def min(_iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT = ...) -> Union[_T, _VT]: ...
def min(_iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ...
@overload
def min(_iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ...
else:
@overload
def min(_arg1: _T, _arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ...