mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Implement hash for CompletableGithubObject (#1922)
Since CompletableGithubObject already uses its URL attribute to implement equality, extend it to also use that attribute for hashing. Fixes #1826
This commit is contained in:
@@ -286,6 +286,9 @@ class CompletableGithubObject(GithubObject):
|
||||
def __eq__(self, other):
|
||||
return other.__class__ is self.__class__ and other._url.value == self._url.value
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self._url.value)
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self == other
|
||||
|
||||
|
||||
Reference in New Issue
Block a user