def __lt__(self, other):
        """Check if self should sort less than other."""
        if self.file == other.file:
            if self.line == other.line:
                return self.code < other.code

            return self.line < other.line

        return self.file < other.file
def __lt__ ( self , other ) : if self . file == other . file : if self . line == other . line : return self . code < other . code return self . line < other . line return self . file < other . file
Check if self should sort less than other.