-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
unidiomatic-typecheck
not flagged for type(x) is type(y)
#10365
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
Comments
None of those replacements deal with the case where you actually want to check the exact type, right? They would all pass if the type of |
Exactly. The spirit of the message as I understand it is to discourage that kind of exact check. |
I have some use cases in my codebases where I need this, but would personally be fine with having to disable the check there. This is likely a case where we need input from the primer to determine how good/bad it would be? |
The linked MR with a fix already exists and does not have a very good primer imo, see #10372 (comment). I think this is an opinionated check and my intuition is that it's been toned down in the past. I'm currently git blaming the code to see the reasoning for the way the code is right now and have a more informed opinion. (made the comment to point out that the fix/primer already exists)/ Edit: ff4e14 from #299, the discussion from bitbucket is lost https://bitbucket.org/logilab/pylint/issues/299 |
Following up, there's not a lot of argument from the git blame. But I personally think the initial intention was to warn when |
We should add an exception for uses inside |
The spirit of
unidiomatic-typecheck
is to flag unidiomatic typechecks.This is unidiomatic:
It should be one of:
The text was updated successfully, but these errors were encountered: