hash == id
authormohammed chamma <hms.mohammed@gmail.com>
Thu, 31 Dec 2020 03:12:24 +0000 (22:12 -0500)
committerGitHub <noreply@github.com>
Thu, 31 Dec 2020 03:12:24 +0000 (22:12 -0500)
Co-authored-by: Harmon <Harmon758@gmail.com>
tweepy/models.py

index a7a5c6d5862018d052b738de174f7f8bef562b2b..f29059437bc0b39448c58098afd0256d84e30871 100644 (file)
@@ -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):