PY3.R1701
Consider merging isinstance
Used when multiple consecutive isinstance calls can be merged into one.
Noncompliant Code:
Copy
from typing import Any
def is_number(value: Any) -> bool:
return isinstance(value, int) or isinstance(value, float)
Compliant Code:
Copy
from typing import Any
def is_number(value: Any) -> bool:
return isinstance(value, (int, float))