Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Commit 9e5a863

Browse files
committed
use a better unhashable implementation for payload
1 parent 6f9e436 commit 9e5a863

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: thriftpy/thrift.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ def gen_init(cls, thrift_spec=None, default_spec=None):
106106

107107
class TPayload(with_metaclass(TPayloadMeta, object)):
108108

109+
__hash__ = None
110+
109111
def read(self, iprot):
110112
iprot.read_struct(self)
111113

@@ -123,9 +125,6 @@ def __eq__(self, other):
123125
return isinstance(other, self.__class__) and \
124126
self.__dict__ == other.__dict__
125127

126-
def __hash__(self):
127-
raise TypeError("unhashable type: 'thriftpy.thrift.TPayload'")
128-
129128
def __ne__(self, other):
130129
return not self.__eq__(other)
131130

0 commit comments

Comments
 (0)