A variable, parameter, function or class is named l, O or I

tx0/python:ambiguous-namestrictwarningstyle

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.

Example from the rule's tests
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
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

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:

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.