-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Incorrect scenario of unidiomatic-typecheck #10161 #10170
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #10170 +/- ##
==========================================
- Coverage 95.83% 95.83% -0.01%
==========================================
Files 174 174
Lines 18995 18993 -2
==========================================
- Hits 18204 18202 -2
Misses 791 791
|
type(a) is not type({}) | ||
type(a) is type("") | ||
type(a) is not type("") | ||
type(a) == type([]) |
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.
Doesn't the issue say that we don't want to suggest this but only exclude the is
and is not
comparisons?
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.
I think @zenlyj wanted to treat ==
similarly to is
.
type(a) is not type({}) | ||
type(a) is type("") | ||
type(a) is not type("") | ||
type(a) == type([]) |
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.
I think @zenlyj wanted to treat ==
similarly to is
.
right_arg = utils.safe_infer(right.args[0]) | ||
if not isinstance(right_arg, LITERAL_NODE_TYPES): | ||
# not e.g. type(x) == type([]) | ||
return | ||
return |
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.
I'm not sure I would change this.
Type of Changes
Description
Closes #10161