-
-
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
The simplifiable-if-expression
message description should not only mention bool(test)
#5882
Comments
@LefterisJP Can't you write: B = TEST_VAR2 == 'True' |
yes indeed, but what I understood for simplifiable-if-expression was telling me to use bool(): https://vald-phoenix.github.io/pylint-errors/plerr/errors/refactoring/R1719.html Perhaps I misunderstood the error then? |
Ah, it seems like that information is incorrect. We should update the description of that message. Btw: That project (although helpful) is not the "official" |
simplifiable-if-expression
message description should not only mention bool(test)
Bug description
Here is a simple example
Configuration
No response
Command used
Pylint output
Expected behavior
I would only expect the first
simplifiable-if-expression
warning forA
.For
B
simplifying it would not work since it's comparing against the stringTrue
and eventually the stringFalse
andbool(string)
is alwaysTrue
Pylint version
OS / Environment
Linux 5.16.12-arch1-1 #1 SMP PREEMPT Wed, 02 Mar 2022 12:22:51 +0000 x86_64 GNU/Linux
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: