Skip to content

Commit e0964e7

Browse files
RonMcKaytbabej
authored andcommitted
Add __lt__ and __gt__ methods to LazyUUIDTaskSet
1 parent 11c8188 commit e0964e7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tasklib/lazy.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,24 @@ def __le__(self, other):
165165
def __ge__(self, other):
166166
return self.issuperset(other)
167167

168+
def __lt__(self, other):
169+
return self.isstrictsubset(other)
170+
171+
def __gt__(self, other):
172+
return self.isstrictsuperset(other)
173+
168174
def issubset(self, other):
169175
return all([task in other for task in self])
170176

171177
def issuperset(self, other):
172178
return all([task in self for task in other])
173179

180+
def isstrictsubset(self, other):
181+
return len(set(t['uuid'] for t in other) - self._uuids) > 0
182+
183+
def isstrictsuperset(self, other):
184+
return len(self._uuids - set(t['uuid'] for t in other)) > 0
185+
174186
def union(self, other):
175187
return LazyUUIDTaskSet(
176188
self._tw,

0 commit comments

Comments
 (0)