Closed
Description
Mypy gives a bogus error when giving a lambda that returns None
when a callable returning None
is expected:
from typing import Callable
def f(x: Callable[[], None]) -> None: pass
# Argument 1 to "f" has incompatible type Callable[[], None]; expected Callable[[], None]
f(lambda: None)
Likely this is due to Void
vs. NoneTyp
, and we'd have to replace an inferred NoneTyp
of a lambda expression with Void
.