From 3a5e16050418b473b72054ffc03c2dd1efef643b Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 20 Jul 2020 18:03:48 -0700 Subject: [PATCH] Add Path.__lt__ so they are sortable. --- voussoirkit/pathclass.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/voussoirkit/pathclass.py b/voussoirkit/pathclass.py index 4f0b8de..7ace84f 100644 --- a/voussoirkit/pathclass.py +++ b/voussoirkit/pathclass.py @@ -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))