-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
How to handle mypy implementation errors? #4256
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
Comments
The mypy documentation of this issue can be found here: https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports |
@cclauss just pointed out to me that the automatic checks already include the ignore-missing-imports parameter, so the implementation errors don't need to be fixed. See https://github.com/TheAlgorithms/Python/blob/master/.pre-commit-config.yaml#L33 |
Those tests are commented out so it would be awesome if we could put the fixes in place so that we can automatically run |
%
|
So... We can successfully run % |
Let's focus the mypy discussions on #4052 |
Many of the current errors when running the command
mypy .
are implementation errors of the following form:scheduling\shortest_job_first.py:8: error: Cannot find implementation or library stub for module named 'pandas'
. These errors can be fixed by adding the comment# type: ignore
at the end of the line, thereby telling mypy to ignore them, for exampleimport pandas as pd # type: ignore
. But all these errors can be silenced by running the commandmypy . --ignore-missing-imports
, avoiding the need to fix them one by one. So the question is: should these errors be fixed for each file or can they be ignored since the check to be implemented will silence them anyways? Without the ignore-parameter, we have:Found 586 errors in 189 files
. With it, we have:Found 477 errors in 132 files
.The text was updated successfully, but these errors were encountered: