From: mohammed chamma Date: Wed, 30 Dec 2020 23:45:08 +0000 (-0500) Subject: Merge branch 'master' into patch-1 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8583af0e419a95120e032a495e37fc2641f75da3;p=tweepy.git Merge branch 'master' into patch-1 --- 8583af0e419a95120e032a495e37fc2641f75da3 diff --cc tweepy/models.py index ac0de53,476eb06..a7a5c6d --- a/tweepy/models.py +++ b/tweepy/models.py @@@ -217,20 -211,7 +211,13 @@@ class User(Model) return NotImplemented - def __ne__(self, other): - result = self == other - - if result is NotImplemented: - return result - - return not result - + def __hash__(self): + if hasattr(self, 'id'): + return self.id + else: + raise TypeError('unhashable type: {} (no id attribute)'.format(type(self))) + + class DirectMessage(Model): @classmethod