pylint-dev / pylint

It's not just a linter that annoys you!
https://pylint.readthedocs.io/en/latest/
GNU General Public License v2.0
5.25k stars 1.12k forks source link

False negatives `superfluous-parens` with more than one superfluous parenthesis #5361

Open KotlinIsland opened 2 years ago

KotlinIsland commented 2 years ago

Current problem

for (i) in [1]:  # superfluous-parens
    print(i)

for ((i)) in [1]:  # no warning
    print(i)

Desired solution

warning on both

Additional context

from #5334

jacobtylerwalls commented 2 years ago

See discussion -- we might be able to revert most of the changes from #4948 to solve this. Just check #4907 for any legitimate cases.

clavedeluna commented 1 year ago

Investigating this and trying to translate the context into an actionable. Is the new consensus that any test case except the one with startswith(( in tests/functional/s/superfluous_parens.py which contains (( and does not report superfluous-parens should now do so?

@jacobtylerwalls