Skip to content

Commit 81abc6a

Browse files
Fixed mypy error for equality checks on ByteString
1 parent 945e52a commit 81abc6a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pycardano/serialization.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@ class ByteString:
6767
def __hash__(self):
6868
return hash(self.value)
6969

70-
def __eq__(self, other: Union[bytes, ByteString]):
70+
def __eq__(self, other: object):
7171
if isinstance(other, ByteString):
7272
return self.value == other.value
73-
else:
73+
elif isinstance(other, bytes):
7474
return self.value == other
75+
else:
76+
return False
7577

7678

7779
@dataclass

0 commit comments

Comments
 (0)