Skip to content

Commit d73f26d

Browse files
author
Dana Powers
committed
Add __hash__ method to Struct
1 parent 6d48a1c commit d73f26d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kafka/protocol/struct.py

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ def __repr__(self):
4444
key_vals.append('%s=%s' % (name, field.repr(self.__dict__[name])))
4545
return self.__class__.__name__ + '(' + ', '.join(key_vals) + ')'
4646

47+
def __hash__(self):
48+
return hash(self.encode())
49+
4750
def __eq__(self, other):
4851
if self.SCHEMA != other.SCHEMA:
4952
return False

0 commit comments

Comments
 (0)