-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
These corners are a direct result of #274.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -256,9 +256,24 @@ def __eq__(self, other): | |
if self is other: | ||
return True | ||
|
||
return (self._dataset_id == other._dataset_id and | ||
self.namespace() == other.namespace() and | ||
self.path() == other.path()) | ||
if not isinstance(other, self.__class__): | ||
return False | ||
|
||
# Check that paths match. | ||
if self.path() != other.path(): | ||
return False | ||
|
||
# Check that datasets match. | ||
if not (self._dataset_id == other._dataset_id or | ||
self._dataset_id is None or other._dataset_id is None): | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dhermes
Author
Contributor
|
||
return False | ||
|
||
# Check that namespaces match. | ||
if not (self._namespace == other._namespace or | ||
self._namespace is None or other._namespace is None): | ||
This comment has been minimized.
Sorry, something went wrong.
tseaver
Contributor
|
||
return False | ||
|
||
return True | ||
|
||
def __ne__(self, other): | ||
return not self.__eq__(other) |
Why special casing for None? If both are None, shouldn't the keys be equivalent?