示例#1
0
	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 __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
示例#3
0
		def key(row):
			return tuple(sortKey(row.get(field, None)) for field in fields)
示例#4
0
 def key(idx):
     return tuple(sortKey(self.column(field)[idx]) for field in fields)
示例#5
0
 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)
示例#6
0
def sortRowKey(row):
	return tuple(sortKey(v) for v in row)
示例#7
0
 def key(row):
     return tuple(sortKey(row.get(field, None)) for field in fields)
def sortRowKey(row):
    return tuple(sortKey(v) for v in row)
示例#9
0
		def key(idx):
			return tuple(sortKey(self.column(field)[idx]) for field in fields)
示例#10
0
	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)