-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong file blamed for a mixture of NamedTuple and passing a function instead of type. #8511
Labels
Comments
msullivan
added
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
priority-0-high
labels
Mar 16, 2020
Oh this looks nasty. Anything that gives errors in the wrong file is really bad! |
Yes, it was quite tricky to find that the error was because in a completely different file someone used numpy.array instead of numpy.ndarray. |
msullivan
added a commit
that referenced
this issue
Mar 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Are you reporting a bug, or opening a feature request?
bug
Please insert below the code you are checking with mypy,
Run: mypy file2.py --follow-imports=silent
What is the actual behavior/output?
The error message is:
file2.py:8: error: Name 'foo' is not defined
-> Note that file2.py has no line 8 (it the problematic line in file1.py) and no mention of
foo
.When reducing this case I've found that removing --follow-import-silent gives an error message about file1.py which is actionable, but the other message is still present and is wrong, since the line number refers to a line in file1.py.
mypy 0.761 on Python 3.5.2
--follow-imports=silent
The text was updated successfully, but these errors were encountered: