Sorting dict keys

zacherates zacherates at gmail.com
Sat Jul 21 16:36:58 CEST 2007


>From ESR's "Why python?"

b = a.keys(); b.sort()

Two statements, one line.  Doesn't create an incidental copy the way
sorted does but I'm not sure how much you like to jam on one line.

Cheers,
   Aaron




More information about the Python-list mailing list