x = 23 print(x) x = "Python" print(x) x = ["a", "b"] print(x)
python simple.py works without complaining.
mypy simple.py reports the following:
simple.py:5: error: Incompatible types in assignment (expression has type "str", variable has type "int") simple.py:8: error: Incompatible types in assignment (expression has type "List[str]", variable has type "int") Found 2 errors in 1 file (checked 1 source file)