Closed
Description
from typing import Iterable, Optional
a: list[Optional[int]] = [1, None, 2]
b: Iterable[int] = filter(lambda x: x is not None, a) # a.py:3: error: Argument 2 to "filter" has incompatible type "List[Optional[int]]"; expected "Iterable[int]"
c: Iterable[int] = (x
for x in a
if x is not None) # Works great!