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

Commit

Permalink
use a better unhashable implementation for payload
Browse files Browse the repository at this point in the history
  • Loading branch information
lxyu committed Mar 24, 2016
1 parent 6f9e436 commit 9e5a863
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions thriftpy/thrift.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down

0 comments on commit 9e5a863

Please sign in to comment.