pylint-dev/pylint

False negative ``superfluous-parens`` when around two conditional and an ``and``

Open

#10.084 geöffnet am 18. Nov. 2024

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Python (1.059 Forks)batch import
False Negative 🦋Good first issueNeeds PR

Repository-Metriken

Stars
 (4.978 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 58T 21h) (63 gemergte PRs in 30 T)

Beschreibung

Bug description

This code should raise C0325:

a = 1

if (1 == 1 and 2 == 1):
    pass

if (a is None and a is not None):
    pass

Command used

pylint --disable=all --enable=C0325 kk.py

Pylint output

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 0.00/10, +10.00)

Expected behavior

Raise C0325

Pylint version

pylint 3.3.1
astroid 3.3.5
Python 3.12.7 (tags/v3.12.7:0b05ead, Oct  1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]

Contributor Guide