From 97a6d27558d3c01b5d69c886d17f8d0beb4d9edc Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Fri, 9 Dec 2016 16:52:03 -0800 Subject: [PATCH] Make first argument to `filter` optional ``` $ python3.4 Python 3.4.3 (default, Nov 17 2016, 01:08:31) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> list(filter(None, [False, True])) [True] >>> ``` --- stdlib/3/builtins.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 7bf2f962a..3847506a8 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -696,7 +696,7 @@ def eval(source: str, globals: Dict[str, Any] = None, 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: ... -def filter(function: Callable[[_T], Any], iterable: Iterable[_T]) -> Iterator[_T]: ... +def filter(function: Optional[Callable[[_T], Any]], iterable: Iterable[_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]: ...