Several isinstance calls on the same value are joined with or, where one call with a tuple of types says the same

tx0/python:isinstance-calls-mergeableallnotestyle/conventionsdepth faststyle

What it finds

isinstance(x, int) or isinstance(x, float) repeats the value and the call; isinstance(x, (int, float)) tests all the types at once.

From the rule's source, isinstance_calls_mergeable.rs.

Example from the rule's tests
def number(x, y):    a = isinstance(x, int) or isinstance(x, float)tx0 reports: one isinstance with a tuple of types tests the same    b = isinstance(x, int) or isinstance(y, int)    return a, b
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 all tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/python:isinstance-calls-mergeable" = "note"

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:isinstance-calls-mergeable] reason="..."

tx0 explain tx0/python:isinstance-calls-mergeable shows the same in the terminal. Found a false positive? Report it.