-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
Running mypy on the following file, lambdas.py:
from typing import Any, Callable
def apply(d, f):
# type: (int, Callable[[Any], None]) -> None
f(d)
apply(1, lambda x: None)
I get the error
lambdas.py:6: error: Argument 2 to "apply" has incompatible type Callable[[Any], None]; expected Callable[[Any], None]
It seems like mypy is having trouble inferring the right thing about the given inline lambda function with python 2 style annotations.
Also, the error message seems misleading because it's claiming the incompatible type is not the expected, but the error message says they're both the same thing.
mypy 0.4.2
python 3.5.0
Thanks!
Metadata
Metadata
Assignees
Labels
No labels