Apply suggestions from code review

This commit is contained in:
Pierre Sassoulas 2023-08-01 23:01:07 +02:00 committed by GitHub
parent e2c806b8e5
commit c8fb4197ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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 other_side = right if isinstance(left, ApproxBase) else left
explanation = approx_side._repr_compare(other_side) explanation = approx_side._repr_compare(other_side)
elif isinstance(left, type(right)) and ( elif type(left) is type(right)
isdatacls(left) or isattrs(left) or isnamedtuple(left) isdatacls(left) or isattrs(left) or isnamedtuple(left)
): ):
# Note: unlike dataclasses/attrs, namedtuples compare only the # Note: unlike dataclasses/attrs, namedtuples compare only the

View File

@ -1573,4 +1573,4 @@ class TestBinaryAndTextMethods:
x.write_text(part, "ascii") x.write_text(part, "ascii")
s = x.read_text("ascii") s = x.read_text("ascii")
assert s == part assert s == part
assert isinstance(s, type(part)) assert type(s) is type(part)