sorting a dictionary

jcm joshway_without_spam at myway.com
Thu Feb 20 08:46:15 EST 2003


user at domain.invalid wrote:

> How about creating a sorted dictionary then? That is, add elements
> to the dictionary in the order they are supposed to be in.
> Is that not possible?

Python dictionaries are unordered.  The best you can probably do is to
keep a separate list of sorted keys.




More information about the Python-list mailing list