-
-
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
False positive comparison-with-callable
when comparing two callables
#7724
Comments
comparison-with-callable
comparison-with-callable
when comparing two callables
There is no way for Sorry for not being able to help, but I'm closing this issue until somebody has a reproducer that we would be reasonably able to infer. |
But At any rate, what do you suggest I do to avoid the warning? Thank you. |
We don't have the definition of |
How about restricting the warning to the case when you can infer that one side in the comparison is callable while the other is not? |
Sure we usually favor false negatives when the inference fail, we should also do that here. |
Why not use |
If I use If I use I'm using python 3.10 |
Comparing methods with |
Bug description
W0143(comparison-with-callable)
is issued for no good reason, when both parts are callable:here the clear intent is to compare callables, so the warning appears to be unnecessary.
While I can disable it, it seems that it should not be issued when both parts of the comparison are callable.
Configuration
Command used
Pylint output
a.py:12: [W0143(comparison-with-callable), main] Comparing against a callable, did you omit the parenthesis?
Expected behavior
no diagnostics
Pylint version
OS / Environment
popos 22.04
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: