Make filter work properly with Optional elements (#775)

This commit is contained in:
David Fisher
2016-12-15 17:53:38 -08:00
committed by Guido van Rossum
parent 6fc57a419b
commit 957307b785
2 changed files with 8 additions and 1 deletions

View File

@@ -680,6 +680,10 @@ def divmod(a: int, b: int) -> Tuple[int, int]: ...
@overload
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]: ...
def format(o: object, format_spec: str = '') -> str: ... # TODO unicode