From 9e5a86300bfa6850a8839226010b6dd78eff0b51 Mon Sep 17 00:00:00 2001 From: lxyu Date: Thu, 24 Mar 2016 22:14:59 +0800 Subject: [PATCH] use a better unhashable implementation for payload --- thriftpy/thrift.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/thriftpy/thrift.py b/thriftpy/thrift.py index 8d474df..0cf0877 100644 --- a/thriftpy/thrift.py +++ b/thriftpy/thrift.py @@ -106,6 +106,8 @@ def gen_init(cls, thrift_spec=None, default_spec=None): class TPayload(with_metaclass(TPayloadMeta, object)): + __hash__ = None + def read(self, iprot): iprot.read_struct(self) @@ -123,9 +125,6 @@ def __eq__(self, other): return isinstance(other, self.__class__) and \ self.__dict__ == other.__dict__ - def __hash__(self): - raise TypeError("unhashable type: 'thriftpy.thrift.TPayload'") - def __ne__(self, other): return not self.__eq__(other)