Skip to content

PLW0128 skips assignment targets in square brackets and after asterisks #18660

@dscorbett

Description

@dscorbett

Summary

redeclared-assigned-name (PLW0128) has false negatives for assignment targets in square brackets or after asterisks. It already correctly checks within parentheses.

$ cat >plw0128.py <<'# EOF'
x, *x = 1, 2
[x, x] = 1, 2
# EOF

$ ruff --isolated check plw0128.py --select PLW0128
All checks passed!

Version

ruff 0.11.13 (5faf72a 2025-06-05)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions especially welcomeruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions