Warn on module level type ignore with error code#13512
Merged
hauntsaninja merged 4 commits intopython:masterfrom Aug 26, 2022
Merged
Warn on module level type ignore with error code#13512hauntsaninja merged 4 commits intopython:masterfrom
hauntsaninja merged 4 commits intopython:masterfrom
Conversation
Per-module error codes were added in python#13502, let's recommend using them. The existing type ignore behaviour is pretty unintuitive; I think most people actually want `# mypy: ignore-errors`. There are probably people depending on the current behaviour though. Fixes python#13435, fixes python#12076, fixes python#11999, fixes python#11027, fixes python#9318, fixes python#7839
This comment has been minimized.
This comment has been minimized.
3 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
sobolevn
approved these changes
Aug 26, 2022
LarsMichelsen
pushed a commit
to Checkmk/checkmk
that referenced
this pull request
Nov 9, 2022
mypy 0.990 contains the change python/mypy#13512, so we are forced to use the latest & greatest way of specifying module-level typing suppressions now. Note that it is not possible to split these fixed from the mypy update itself: Previous versions don't understand the new way and the current version complains about the old way. Great upgrade path! :-/ Change-Id: I2c54bcfd65729967f0beb4a8aebe367ffb2744c7
tony
added a commit
to tmux-python/tmuxp
that referenced
this pull request
Jun 1, 2024
I do not think this handled the solution surgically, it seems to force losing safety for the rule across a *whole file* rather than surgically at the offending line. See also: python/mypy#12076, python/mypy#13512
tony
added a commit
to tmux-python/tmuxp
that referenced
this pull request
Jun 1, 2024
I do not think this handled the solution surgically, it seems to force losing safety for the rule across a *whole file* rather than surgically at the offending line. See also: python/mypy#12076, python/mypy#13512
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per-module error codes were added in #13502, let's recommend using them.
The existing type ignore behaviour is pretty unintuitive; I think most
people actually want
# mypy: ignore-errors. There are probably peopledepending on the current behaviour of
# type: ignorethough.Fixes #13435, fixes #12076, fixes #11999, fixes #11027, fixes #9318,
fixes #7839