-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add test and docs for top level mypy: disable-error-code
comment
#14810
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, could you also update the error message here:
Line 494 in d586070
"use `# mypy: disable-error-code=...`" |
Yes, looks fine. Thank you for your work. But regarding the typing and using mypy I'm a beginner, so don't count on my opinion too much. |
@xitop beginners provide the best feedback for the docs! Thank you for the report 👍 |
@hauntsaninja we now have smart error message, thanks for the suggestion :) |
@@ -487,11 +487,12 @@ def translate_stmt_list( | |||
and self.type_ignores | |||
and min(self.type_ignores) < self.get_lineno(stmts[0]) | |||
): | |||
if self.type_ignores[min(self.type_ignores)]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't use walrus just yet; we still support 3.7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the first time I've used walrus in real code :)
Probably, the last time.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
I went with the smallest change possible.
@xitop, please, take a look. Does it make sense to you? :)
Closes #14750