Implement equality comparison of CompletableGithubObject (#201)

This commit is contained in:
Vincent Jacques
2013-11-10 16:28:52 -08:00
parent 5692c1ebb2
commit d626f21484
7 changed files with 148 additions and 0 deletions
+6
View File
@@ -213,6 +213,12 @@ class CompletableGithubObject(GithubObject):
GithubObject.__init__(self, requester, headers, attributes, completed)
self.__completed = completed
def __eq__(self, other):
return other.__class__ is self.__class__ and other._url.value == self._url.value
def __ne__(self, other):
return not self == other
def _completeIfNotSet(self, value):
if value is NotSet:
self._completeIfNeeded()