-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Flag all comparisons against builtin types in E721 #8491
Conversation
See astral-sh#8483. Generalised fix on top of astral-sh#8485 Based on the output of `print("\n".join(k for k, v in builtins.__dict__.items() if isinstance(v, type)))`
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
E721 | 222 | 222 | 0 | 0 | 0 |
Nice, thanks -- this looks reasonable to me. |
I'm wondering if this should be part of preview. What do you think @zanieb? It doesn't change the intent of the rule, but it will lead to more violations. (And for some of these, there isn't a great workaround right now, since we don't accept |
I'd be in favour of only landing this change in stable once #7905 is in stable |
| "UserWarning" | ||
| "ValueError" | ||
| "Warning" | ||
| "ZeroDivisionError" |
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.
Let's revert this change (but keep the change in the other matches!
below).
@hauntsaninja -- Yeah same. That would be equivalent to reverting this change in the |
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.
Thanks!
See #8483. Generalised fix on top of #8485
Based on the output of
print("\n".join(k for k, v in builtins.__dict__.items() if isinstance(v, type)))