[Python-Dev] PEP 265 - Sorting Dictionaries by Value

Skip Montanaro skip@pobox.com (Skip Montanaro)
Mon, 20 Aug 2001 23:35:45 -0500


    Grant> ... since Python sorts the list based on the first item of the
    Grant> tuple, the list of (inverted) items is therefore sorted by value.

Well, to be picky, it uses all the elements of the tuple in the comparison,
it's just that the highest priority item is in the first slot. ;-)

Skip