Skip to content

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

Closed
@stdedos

Description

@stdedos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Positive 🦟A message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions