"key" argument of builtin function sorted should be optional in python 2.7 (#3086)

This commit is contained in:
Chad Dombrova
2019-06-22 14:09:51 -07:00
committed by Jelle Zijlstra
parent bdd49d0f3a
commit e25c0cb128
2 changed files with 2 additions and 2 deletions

View File

@@ -1390,7 +1390,7 @@ if sys.version_info >= (3,):
else:
def sorted(__iterable: Iterable[_T], *,
cmp: Callable[[_T, _T], int] = ...,
key: Callable[[_T], Any] = ...,
key: Optional[Callable[[_T], Any]] = ...,
reverse: bool = ...) -> List[_T]: ...
@overload
def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ...

View File

@@ -1390,7 +1390,7 @@ if sys.version_info >= (3,):
else:
def sorted(__iterable: Iterable[_T], *,
cmp: Callable[[_T, _T], int] = ...,
key: Callable[[_T], Any] = ...,
key: Optional[Callable[[_T], Any]] = ...,
reverse: bool = ...) -> List[_T]: ...
@overload
def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ...