mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 08:47:39 +08:00
Patch from @sfreilich: make itertools.ifilter predicate parameter Optional (#1257)
From Samuel Freilich: In Python 2, the predicate parameter in itertools.ifilter and itertools.ifilterfalse can be None, indicating that true or false values should be retained (functionally equivalent to passing "bool" as the predicate). In Python 3, filter and itertools.filterfalse have the same behavior.
This commit is contained in:
committed by
Jelle Zijlstra
parent
d7dd9fb832
commit
8d8a34cb83
@@ -29,7 +29,7 @@ class chain(Iterator[_T], Generic[_T]):
|
||||
def compress(data: Iterable[_T], selectors: Iterable[Any]) -> Iterator[_T]: ...
|
||||
def dropwhile(predicate: Callable[[_T], Any],
|
||||
iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
def filterfalse(predicate: Callable[[_T], Any],
|
||||
def filterfalse(predicate: Optional[Callable[[_T], Any]],
|
||||
iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user