Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Suggested change for use-implicit-booleaness-not-comparison doesn't seem right #9353

Copy link
Copy link
@clavedeluna

Description

@clavedeluna
Issue body actions

Bug description

z = []
res = z != []

Configuration

enable=use-implicit-booleaness-not-comparison

Command used

pylint test.py

Pylint output

test.py:2:6: C1803: "z != []" can be simplified to "z", if it is strictly a sequence, as an empty list is falsey (use-implicit-booleaness-not-comparison)

Expected behavior

While in an if statement if z != []: pass The suggestion is right, in an assignment context I don't think it is. Changing
res = z != [] to res = z is not the same thing

Pylint version

pylint 3.0.0

OS / Environment

No response

Additional dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement ✨Improvement to a componentImprovement to a componentNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis 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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.