Skip to content

ambiguous-function-name

Pythonstyleno fixdefault: off

Reports a function or method named l, O or I.

In many fonts l (lower case L), I (upper case i) and the digit 1 look alike, and so do O and 0. A call such as l(x) or O(x) is easy to misread as an expression with a number.

To fix, give the function a name that says what it does.

Reported
...
pass
def O():
pass
...
python:
lint:
rules:
ambiguous-function-name: warn # off (default), warn, error

Suppress one line with sudsy-disable-next-line ambiguous-function-name in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
ruff E743 full