redeclared-assigned-name (PLW0128)#
Derived from the Pylint linter.
This rule is unstable and in preview. The --preview
flag is required for use.
What it does#
Checks for declared assignments to the same variable multiple times in the same assignment.
Why is this bad?#
Assigning a variable multiple times in the same assignment is redundant, as the final assignment to the variable is what the value will be.
Example#
Use instead: