A variable, parameter, function or class is named l, O or I
What it finds
In many fonts l looks like 1 and I, and O like 0, so l = 1 or O == 0 are easy to misread. Checked are all names bound by assignment, for, with, except, a parameter, def or class; uses of names bound elsewhere, such as attributes, are not.
From the rule's source, ambiguous_name.rs.
def total(values, O):tx0 reports: the name O is easy to confuse l = len(values)tx0 reports: the name l is easy to confuse l = l + 1 for I in values:tx0 reports: the name I is easy to confuse pass return obj.l + length Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/python:ambiguous-name" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
# tx0: ignore[tx0/python:ambiguous-name] reason="..."tx0 explain tx0/python:ambiguous-name shows the same in the terminal. Found a false positive? Report it.