You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
inconsistent behavior depending on the file path being checked #11697
>mypy projects/mypy/a.py
Success: no issues found in 1 source file
>mypy projects/other/a.py
b.py:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
Found 1 error in 1 file (checked 1 source file)
I have no idea whats going on here, I can consistently reproduce it with these folders(projects/mypy), but not any other folder.
changed the title [-]inconsistent behavior depending on where mypy is invoked[/-][+]inconsistent behavior depending on the file path being checked[/+]on Dec 10, 2021
Activity
[-]inconsistent behavior depending on where mypy is invoked[/-][+]inconsistent behavior depending on the file path being checked[/+]sobolevn commentedon Dec 10, 2021
What if you rename
projects/mypy/a.pytoprojects/my_mypy/a.py?KotlinIsland commentedon Dec 10, 2021
Then the error correctly displays
sobolevn commentedon Dec 10, 2021
I guess the problem is in name shadowing 🤔
KotlinIsland commentedon Dec 10, 2021
It's highly bizarre, any python files in the mypy directory don't check properly, regardless of the current directory where I invoke mypy.
And some things do check properly, if I change b.py to
1 + ""then an error is reported.