Improving upon the Decorate-Sort-Undecorate idiom

Thomas Philips tkpmep at
Tue Jun 22 22:12:23 CEST 2004

I recently had the need to sort a large number of lists of lists, and
wondered if an improvement to the Decorate-Sort-Undecorate idiom is in
the works. Ideally, I would like to sort the list of lists (or tuples)
in place by using a simple variant of the current idiom, i.e.


where *columns is a tuple that specifies the column order for the
sort. If *columns is left blank, the sort ought to work as it does
today, i.e.


should sort by columns 0, 1,2,.....

Has such a method been considered for inclusion in Python? Does it
have any problems that would inhibit its adoption?

Thomas Philips

More information about the Python-list mailing list