> l=map(lambda x:(x[1][2], x[1][1], x[1][0], x[0]), mydict.items()) > l.sort() A faster version along those lines might be l = map (None, mydict.values (), mydict.keys ()) l.sort () l.reverse () ...but your version seems to be doing something different to what I thought Rob was doing, so perhaps I've misunderstood. Alex.