?Does Python have sorting via "Dictionary Order"?

Andrew Dalke dalke at acm.org
Sat Jul 1 02:37:01 EDT 2000


Christopher Browne wrote in message ...
>Centuries ago, Nostradamus foresaw a time when Norman Shelley would say:
>>Does Python have sorting via "Dictionary Order"?  This would be a very
>>handy addition as an option to list's sort() function.
>
>Feel free to avail yourself of the documentation...
>
>"The keys() method of a dictionary object returns a list of all the
>keys used in the dictionary, in random order (if you want it sorted,
>just apply the sort() method to the list of keys)."


I do believe you misunderstood the original poster's question.  He
gave a description of "Dictionary Order" based on how words in a
paper-bound dictionary (as in the Oxford English Dictionary) might
be ordered.  He was not refering to their order as used in a Python
dictionary data structure (mapping unique keys to values).

                    Andrew
                    dalke at acm.org








More information about the Python-list mailing list