'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.'

def sort(self, cmp=None, key=None, reverse=False):

    o = order(list(self), cmp, key, reverse)
    r = list(self._datasheet)
    [self._datasheet.__setitem__(i2, r[i1]) for (i2, i1) in enumerate(o)]
