X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/b2edb6ff48f75b9a823e4cdbcf6f375d9e1c7c84..de0d843d5b31a9b2c8e78819020a59d252e18e39:/tasklib/lazy.py diff --git a/tasklib/lazy.py b/tasklib/lazy.py index 7d8e0de..e5b3492 100644 --- a/tasklib/lazy.py +++ b/tasklib/lazy.py @@ -36,6 +36,9 @@ class LazyUUIDTask(object): # For saved Tasks, just define equality by equality of uuids return self['uuid'] == other['uuid'] + def __ne__(self, other): + return not self.__eq__(other) + def __hash__(self): return self['uuid'].__hash__() @@ -103,7 +106,7 @@ class LazyUUIDTaskSet(object): return 'LazyUUIDTaskSet([{0}])'.format(', '.join(self._uuids)) def __eq__(self, other): - return set(t['uuid'] for t in other) == self._uuids + return (set(t['uuid'] for t in other) if other else set()) == self._uuids def __ne__(self, other): return not (self == other)