Add Path.__lt__ so they are sortable.

This commit is contained in:
Ethan Dalool 2020-07-20 18:03:48 -07:00
parent 5412af7d90
commit 3a5e160504

View file

@ -99,6 +99,9 @@ class Path:
def __hash__(self):
return hash(self.normcase)
def __lt__(self, other):
return self.absolute_path < other.absolute_path
def __repr__(self):
return '{c}({path})'.format(c=self.__class__.__name__, path=repr(self.absolute_path))