Make hint comparison more intelligent

"easy foo/1 bar/2" and "easy bar/2 foo/1" are simply different ways of
writing the same hint, so the corresponding Hint objects should compare
as equal.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
master
Adam D. Barratt 11 years ago
parent 16984f345c
commit a799ce3df1

@ -77,7 +77,12 @@ class Hint(object):
return self._hint
def __eq__(self, other):
return str(self) == str(other)
if self.type != other.type:
return False
elif self.type == 'age-days' and self.days != other.days:
return False
else:
return frozenset(self.packages) == frozenset(other.packages)
@property
def type(self):

Loading…
Cancel
Save