From: Tomas Babej Date: Fri, 26 Dec 2014 15:34:44 +0000 (+0100) Subject: Task: Make two Tasks equal by uuid X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/351a4268660a1d24d7893b2e3ce8daa8f131f966 Task: Make two Tasks equal by uuid --- diff --git a/tasklib/task.py b/tasklib/task.py index bb3fa53..336c050 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -112,6 +112,12 @@ class Task(TaskResource): def __unicode__(self): return self['description'] + def __eq__(self, other): + return self['uuid'] == other['uuid'] + + def __hash__(self): + return self['uuid'].__hash__() + @property def completed(self): return self['status'] == six.text_type('completed')