Help with multiple key sort

Paul Rubin http
Tue Feb 6 13:42:53 EST 2007


ian.brady1 at gmail.com writes:
> It moves right while keeping sorted order to the left.  This is the
> new stable sort in 2.5.

>>> b
['1 one 2', '1 one 1', '1 two 1', '1 one 0', '1 xx   0']
>>> sorted(b,key=lambda x: x.split())
['1 one 0', '1 one 1', '1 one 2', '1 two 1', '1 xx   0']



More information about the Python-list mailing list