MCPcopy Index your code
hub / github.com/clips/pattern / sort

Method sort

pattern/db/__init__.py:2128–2134  ·  view source on GitHub ↗

Sorts the rows in the matrix according to the values in this column, e.g. clicking ascending / descending on a column header in a datasheet viewer.

(self, cmp=None, key=None, reverse=False)

Source from the content-addressed store, hash-verified

2126 row = self._datasheet.pop(i); return row[self._j]
2127
2128 def sort(self, cmp=None, key=None, reverse=False):
2129 """ Sorts the rows in the matrix according to the values in this column,
2130 e.g. clicking ascending / descending on a column header in a datasheet viewer.
2131 """
2132 o = order(list(self), cmp, key, reverse)
2133 # Modify the table in place, more than one variable may be referencing it:
2134 r=list(self._datasheet); [self._datasheet.__setitem__(i2, r[i1]) for i2, i1 in enumerate(o)]
2135
2136 def insert(self, i, value, default=None):
2137 """ Inserts the given value in the column.

Callers

nothing calls this directly

Calls 2

orderFunction · 0.85
__setitem__Method · 0.45

Tested by

no test coverage detected