Use isinstance instead of type comparison with equal to appease the linter
This commit is contained in:
parent
f82c63ac4d
commit
e2c806b8e5
|
@ -222,7 +222,7 @@ def _compare_eq_any(left: Any, right: Any, verbose: int = 0) -> List[str]:
|
|||
other_side = right if isinstance(left, ApproxBase) else left
|
||||
|
||||
explanation = approx_side._repr_compare(other_side)
|
||||
elif type(left) == type(right) and (
|
||||
elif isinstance(left, type(right)) and (
|
||||
isdatacls(left) or isattrs(left) or isnamedtuple(left)
|
||||
):
|
||||
# Note: unlike dataclasses/attrs, namedtuples compare only the
|
||||
|
|
|
@ -1573,4 +1573,4 @@ class TestBinaryAndTextMethods:
|
|||
x.write_text(part, "ascii")
|
||||
s = x.read_text("ascii")
|
||||
assert s == part
|
||||
assert type(s) == type(part)
|
||||
assert isinstance(s, type(part))
|
||||
|
|
Loading…
Reference in New Issue