4 ms·
Is there a ruff rule for this?
by mr_mitm 1y ago
Is there a ruff rule for this?
- maleldil 1y agoThere are [1] and [2] for function arguments and loop variables, respectively, but nothing for the general case. Note that a type checker will complain if you re-assign with a different type. Pylint also has [3] for redefining variables from an outer scope, but Ruff doesn't implement that yet. [1] https://docs.astral.sh/ruff/rules/redefined-argument-from-local/ https://docs.astral.sh/ruff/rules/redefined-argument-from-lo... [2] https://docs.astral.sh/ruff/rules/redefined-loop-name/ https://docs.astral.sh/ruff/rules/redefined-loop-name/ [3] https://pylint.pycqa.org/en/latest/user_guide/messages/warning/redefined-outer-name.html https://pylint.pycqa.org/en/latest/user_guide/messages/warni...