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
Thanks for reporting this! I think the reason is that mypy only recognizes ignore annotations on the last line of a statement, which is clearly broken.
I think that there are also some other cases where # type: ignore might not work correctly. The feature is still going to need a bit more love :-) If you spot any other cases where it behaves strangely, please report them since this is a pretty important feature.
The # type: ignore comment should be put on the line that the error refers to. This way we can only ignore parts of a multi-line statement, which can be useful in cases such as large dict literals.
There seems to be inconsistent behavior between these two equivalent pieces of code.
mypy is happy with this:
but this fails with
"module" has no attribute "NOT_FOUND"
(no matter where I put the annotation):The text was updated successfully, but these errors were encountered: