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
Commit 45b9b1d
Browse filesBrowse the repository at this point in the historyBrowse files
Add basic implementation for mypy: ignore comments (#22180)
Fixes#12358
Implementation is mostly straightforward, but there are few things:
* This requires mypyc/ast_serialize#95, so tests
will fail until we merge that.
* We forgot to bump cache version to `6`. This is trivial however,
functions now have a flag indicating if they have a type comment.
* I found a pretty bad bug in native parser: parse errors cannot be
type-ignored even if they are non-blocking. Again, it is a one line
change, so not making a separate PR for this.
Finally, there is one thing that bothers me a bit: we have few places
where we mention words `type: ignore` in errors and notes. However, it
would take a significant effort to reliably change them to `mypy:
ignore` when needed. Essentially we would need to record provenance for
each error code, and thread it through to many places (including to
cache metas, for some technical reasons). So we have three options:
1. Do nothing about it. `mypy: ignore` really means mypy-specific type
ignore, so it is fine to use `type: ignore` in error notes, if we
actually have `mypy: ignore` written in code.
2. Actually implement all the work needed (not a fan of this option
TBH).
3. Change the wording in those few errors/notes so that it is more
neutral: i.e. say `Unused "ignore" comment` instead of `Unused "type:
ignore" comment` etc.
I am leaning towards option 3, but wanted to double-check before
actually doing this.
0 commit comments