Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adds TypeGuard to filter
Refs #5661
  • Loading branch information
sobolevn authored Oct 9, 2021
commit 86fc066a696e0f773903a3c203b09e39372dece3
3 changes: 3 additions & 0 deletions stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ from typing import (
Tuple,
Type,
TypeVar,
TypeGuard,
Union,
ValuesView,
overload,
Expand Down Expand Up @@ -1035,6 +1036,8 @@ class filter(Iterator[_T], Generic[_T]):
@overload
def __init__(self, __function: None, __iterable: Iterable[_T | None]) -> None: ...
@overload
def __init__(self, __function: Callable[[_S], TypeGuard[_T]], __iterable: Iterable[_S]) -> None: ...
@overload
def __init__(self, __function: Callable[[_T], Any], __iterable: Iterable[_T]) -> None: ...
def __iter__(self) -> Iterator[_T]: ...
def __next__(self) -> _T: ...
Expand Down