projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8373a0a
)
Added the possibility of checking equality between users using the unique `id`s.
author
garos
<Gard-Inge.Rosvold@ffi.no>
Thu, 5 Oct 2017 06:52:33 +0000
(08:52 +0200)
committer
garos
<Gard-Inge.Rosvold@ffi.no>
Thu, 5 Oct 2017 07:01:39 +0000
(09:01 +0200)
tweepy/models.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/models.py
b/tweepy/models.py
index 21449d0374e606525e89f1107f0925a287942dd9..00269ddcf56db349276b67e31381030c4fc2835e 100644
(file)
--- a/
tweepy/models.py
+++ b/
tweepy/models.py
@@
-201,6
+201,20
@@
class User(Model):
*args,
**kargs)
+ def __eq__(self, other):
+ if isinstance(other, User):
+ return self.id == other.id
+
+ return NotImplemented
+
+ def __ne__(self, other):
+ result = self == other
+
+ if result is NotImplemented:
+ return result
+
+ return not result
+
class DirectMessage(Model):