From beb9183103e6cdc5805e64e0f88d7ab80b031cee Mon Sep 17 00:00:00 2001 From: David Fisher Date: Fri, 16 Dec 2016 15:57:04 -0800 Subject: [PATCH] Swap order of overloads to fix filter without strict optional (#779) Related to python/mypy#2587 --- stdlib/2/__builtin__.pyi | 6 +++--- stdlib/3/builtins.pyi | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index ee7b572d5..aaa2aedbc 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -681,11 +681,11 @@ def divmod(a: int, b: int) -> Tuple[int, int]: ... def divmod(a: float, b: float) -> Tuple[float, float]: ... def exit(code: int = ...) -> None: ... @overload -def filter(function: None, - iterable: Iterable[Optional[_T]]) -> List[_T]: ... -@overload def filter(function: Callable[[_T], Any], iterable: Iterable[_T]) -> List[_T]: ... +@overload +def filter(function: None, + iterable: Iterable[Optional[_T]]) -> List[_T]: ... def format(o: object, format_spec: str = '') -> str: ... # TODO unicode def getattr(o: Any, name: unicode, default: Any = None) -> Any: ... def hasattr(o: Any, name: unicode) -> bool: ... diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 0f3c12b97..27d64632d 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -697,9 +697,9 @@ def exec(object: str, globals: Dict[str, Any] = None, locals: Mapping[str, Any] = None) -> Any: ... # TODO code object as source def exit(code: int = None) -> None: ... @overload -def filter(function: None, iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ... -@overload def filter(function: Callable[[_T], Any], iterable: Iterable[_T]) -> Iterator[_T]: ... +@overload +def filter(function: None, iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ... def format(o: object, format_spec: str = '') -> str: ... def getattr(o: Any, name: str, default: Any = ...) -> Any: ... def globals() -> Dict[str, Any]: ...