Mypy doesn't complain about this code that returns a value in a function declared to return None, since the return value is Any:
def f() -> None:
return g() # oops, but no error
def g():
return 1
I think that mypy could complain about the return statement even if the value has type Any. The current behavior is not inconsistent or incorrect, but probably not optimal.
Mypy doesn't complain about this code that returns a value in a function declared to return
None, since the return value isAny:I think that mypy could complain about the return statement even if the value has type
Any. The current behavior is not inconsistent or incorrect, but probably not optimal.