I am using Python 3.8.5 and mypy 0.790.
Running mypy on this code block will raise an error:
# mypy_and_the_walrus.py
z = "asd"
if (p := z):
print('hello') # error: invalid syntax
Running the program is fine:
❯ python -i mypy_and_the_walrus.py
hello
>>> p
'asd'
I have not been able to figure out what the issue is.
Note:
I have a mypy.ini with the python version set to 3.8:
# mypy.ini
[mypy]
python_version = 3.8
This is probably something silly on my end, but I have not been able to find a solution to this.
The only solutions I have found are:
The second one seems like it would have a solution, but the solution is tha