ambiguous-variable-name
What it does
Section titled “What it does”Reports a variable, parameter or global name that is l, O or I.
Why it matters
Section titled “Why it matters”In many fonts l (lower case L), I (upper case i) and the digit 1 look alike, and so do O and 0. In l = O + 1 a reader cannot tell the names from the numbers.
To fix, rename the variable.
Example
Section titled “Example”...
def g(l: "int", O=1, *I): l = 1...Configuration
Section titled “Configuration”python: lint: rules: ambiguous-variable-name: warn # off (default), warn, errorSuppress one line with sudsy-disable-next-line ambiguous-variable-name in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| ruff | E741 |
full |