how to sort a hash list without generating a new object?
thinke365 at gmail.com
Tue Aug 2 20:02:09 CEST 2011
the source code is as follows
x['a'] = 11
x['c'] = 19
x['b'] = 13
tmp = sorted(x.items(), key = lambda x:x) # increase order by
default, if i want to have a descending order, what should i do?
# after sorted is called, a list will be generated, and the hash list
x is not changed at all, how to convert x to a sorted hash list
without generating a new object?
More information about the Python-list