mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Add __eq__ and __hash__ to NamedUser (#706)
* Add __eq__ and __hash__ to NamedUser * Remove extra outer brackets from __eq__ in NamedUser * Add unit tests for __eq__ and __hash__ * Remove redundant brackets in __eq__ : NamedUser
This commit is contained in:
@@ -46,6 +46,12 @@ class NamedUser(github.GithubObject.CompletableGithubObject):
|
||||
def __repr__(self):
|
||||
return self.get__repr__({"login": self._login.value})
|
||||
|
||||
def __hash__(self):
|
||||
return hash((self.id, self.login))
|
||||
|
||||
def __eq__(self, other):
|
||||
return isinstance(other, type(self)) and self.login == other.login and self.id == other.id
|
||||
|
||||
@property
|
||||
def avatar_url(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user