Closed
Description
When checking the following function with mypy 0.730 (Python version 3.7.4):
def foo(x: int) -> str:
return 2 ** x
mypy reports no errors:
Success: no issues found in 1 source file
With the --strict
option turned on, mypy reports:
foo.py:2: error: Returning Any from function declared to return "str"
The expected output would be something like
foo.py:2: error: Incompatible return value type (got "int", expected "str")
Metadata
Metadata
Assignees
Labels
No labels