?Does Python have sorting via "Dictionary Order"?

Christopher Browne cbbrowne at news.hex.net
Fri Jun 30 20:53:39 EDT 2000


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)."
-- 
cbbrowne at ntlug.org - <http://www.ntlug.org/~cbbrowne/scripting.html>
"People need to quit pretending they can invent THE interface and walk
away from it, like some Deist fantasy." -- Michael Peck



More information about the Python-list mailing list