-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Ignore doesn't work when two errors share a line #17655
Comments
Simplified reproducer: from typing import Any
import numpy.typing as npt
m: npt.NDArray[Any]
index: tuple[int, ...]
m[*index, :] which outputs
|
Reproducer without numpy: class Foo:
def __getitem__(self, key: tuple[str, ...]) -> None: ...
m: Foo
index: tuple[int, ...]
m[*index, :] outputs
|
Some notes for posterity:
|
Because slice expressions don't contain information in the raw ast before Python 3.9, fixing this while mypy still supports 3.8 is a bit complicated. Fortunately, mypy will be dropping support for 3.8 in the near future. Once that happens, I have a patch ready. In the meantime, |
Perfect, thanks for all the research and fix! I'll just wait for MyPy to drop 3.8. |
Fixes python#17655 The decorator cleanup moves a type ignore, but so does the bug fix in python#18392 , so might as well batch into a single release
Produces an error without a line number for a line on which the error should be ignored!
The text was updated successfully, but these errors were encountered: