-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-0-high
Description
This example started generating errors after #8077:
from typing import Optional, TypeVar, Iterable, Iterator, List
_T = TypeVar('_T')
def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> List[_T]: ...
x: Optional[str]
# Need type annotation for 'pagelets'
# List item 0 has incompatible type "Optional[str]"; expected "None"
pagelets = filter(None, [x])
The issue also happens with Python 2 filter()
, at least.
cc @ilevkivskyi
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-0-high