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
# type: ignore doesn't work on wrapped lines #8905
In this example, the error produced is error: Explicit "Any" is not allowed [misc].
It says the error is on line 1, but clearly is on line 2.
That's not a problem in itself, I assume it's just treating the wrapped line as a single line.
However, the ignore comment, which is on the correct line, is not recognised by Mypy unless it is moved to the first line. If Mypy is going to treat wrapped lines as a single line, then the comments should also get wrapped to that same line.
Activity
JelleZijlstra commentedon May 27, 2020
To mypy the error is on line 1, so that's where it wants the type ignore to be.
However, on Python 3.8+ I believe we should allow this ignore to work, see #6648.
Dreamsorcerer commentedon May 27, 2020
I'm just suggesting that if Mypy thinks that error is on line 1, then it should also think that the comment is on line 1.
I'm running 3.8.2, so doesn't seem to work in 3.8+.
emmatyping commentedon May 20, 2022
Checking the OP error, it seems to correctly silence the issue (fixed by #6648).