Fix comparison of User to other types. Closes #75.

This commit is contained in:
hugovk 2014-03-01 16:44:13 +02:00
parent 0d483234d4
commit f59d2cc680
2 changed files with 32 additions and 3 deletions

View file

@ -2864,10 +2864,16 @@ class User(_BaseObject):
return self.get_name()
def __eq__(self, another):
return self.get_name() == another.get_name()
if isinstance(another, User):
return self.get_name() == another.get_name()
else:
return False
def __ne__(self, another):
return self.get_name() != another.get_name()
if isinstance(another, User):
return self.get_name() != another.get_name()
else:
return True
def _get_params(self):
return {"user": self.get_name()}