def __lt__(self, other): if self == other: return 0 if isinstance(other, Result): def it(): yield self.key, other.key for k in set(self.__data.keys()).union(other.__data.keys()): yield self.__data.get(k), other.__data.get(k) for s, o in it(): if s != o: return tuple(sortKey(i) for i in s) < tuple(sortKey(i) for i in o) return False if isinstance(other, tuple): return self.key < other
def key(row): return tuple(sortKey(row.get(field, None)) for field in fields)
def key(idx): return tuple(sortKey(self.column(field)[idx]) for field in fields)
def __lt__(self, other): if not isinstance( other, DataColumn) or self.__dataTable is not other.__dataTable: raise NotImplemented() return sortKey(self.header) < sortKey(other.header)
def sortRowKey(row): return tuple(sortKey(v) for v in row)
def __lt__(self, other): if not isinstance(other, DataColumn) or self.__dataTable is not other.__dataTable: raise NotImplemented() return sortKey(self.header) < sortKey(other.header)