Reject invalid type ignores - #83
Merged
Merged
Conversation
Collaborator
Author
|
I found couple more deviations w.r.t. type comments. I am less sure about these two, but they still look quite reasonable:
|
Collaborator
Author
|
In the interest of speeding things up for the mypy release I am going to merge this later today and update python/mypy#21823. @JukkaL please take a look if you will have a chance. |
Contributor
|
@ilevkivskyi Late review:
|
Collaborator
Author
|
@JukkaL Thanks! In both cases the behaviour is indeed different, but TBH I am not sure these are actually worth fixing. Let me know if you feel strongly about any of these:
|
Contributor
|
Yeah, these don't seem worth fixing. |
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.
Fail on
# type: ignorecomments we cannot parse instead of interpreting them as "blanket" ignores. This matches old parser behavior (and IMO makes sense). I also fix a bug, where "blanket" type ignore is ignored if there is no space before trailing comment (again this matches old parser and IMO looks consistent).I only add few tests, as we also have some tests in mypy for this.