From 1af7de3a9f7aef5e05111914c4d70c0e4a5b08ac Mon Sep 17 00:00:00 2001 From: mohammed chamma Date: Wed, 30 Dec 2020 22:12:24 -0500 Subject: [PATCH] hash == id Co-authored-by: Harmon --- tweepy/models.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tweepy/models.py b/tweepy/models.py index a7a5c6d..f290594 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -212,10 +212,7 @@ class User(Model): return NotImplemented def __hash__(self): - if hasattr(self, 'id'): - return self.id - else: - raise TypeError('unhashable type: {} (no id attribute)'.format(type(self))) + return self.id class DirectMessage(Model): -- 2.25.1