mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
filter function: make the callable of the first overload non-optional so that mypy is able to select the second overload for the case. (#1855)
This commit is contained in:
committed by
Jelle Zijlstra
parent
fa98de6d57
commit
1533602779
@@ -804,8 +804,7 @@ def eval(source: Union[str, bytes, CodeType], globals: Optional[Dict[str, Any]]
|
||||
def exec(object: Union[str, bytes, CodeType], globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> Any: ...
|
||||
def exit(code: Any = ...) -> NoReturn: ...
|
||||
@overload
|
||||
def filter(function: Optional[Callable[[_T], Any]],
|
||||
iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
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: ...
|
||||
|
||||
Reference in New Issue
Block a user