Skip to content

use-implicit-booleaness-not-comparison should not be offered in N-way comparisons #10065

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

Closed
stdedos opened this issue Nov 4, 2024 · 0 comments · Fixed by #10246
Closed

use-implicit-booleaness-not-comparison should not be offered in N-way comparisons #10065

stdedos opened this issue Nov 4, 2024 · 0 comments · Fixed by #10246
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@stdedos
Copy link
Contributor

stdedos commented Nov 4, 2024

Bug description

assert a == b == ''

Configuration

No response

Command used

pylint a.py

Pylint output

C1804: "a == b == ''" can be simplified to "not b", if it is striclty a string, as an empty string is falsey (use-implicit-booleaness-not-comparison-to-string)

Expected behavior

Nothing or an acceptable fix

Pylint version

pylint 3.2.2
astroid 3.2.2
Python 3.9.20 (main, Sep 7 2024, 18:35:26)
[GCC 9.4.0]


pylint 3.3.1
astroid 3.3.5
Python 3.9.20 (main, Sep 7 2024, 18:35:26)
[GCC 9.4.0]

OS / Environment

No response

Additional dependencies

No response

@stdedos stdedos added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Nov 4, 2024
@DanielNoord DanielNoord added False Positive 🦟 A message is emitted but nothing is wrong with the code and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Nov 5, 2024
@jacobtylerwalls jacobtylerwalls added the Needs PR This issue is accepted, sufficiently specified and now needs an implementation label Nov 5, 2024
@Pierre-Sassoulas Pierre-Sassoulas added this to the 3.3.5 milestone Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants