how to keep order key in a dictionary

Jeff McNeil jeff at
Sun Nov 4 14:52:05 CET 2007

.  In short, keys() and items() return an arbitrary ordering.  I think  
that will do what  
you want if key ordering is a necessity.

On Nov 4, 2007, at 8:19 AM, azrael wrote:

> I 'm currenty working on a project for which it would be great to use
> a dictionary. At the begining I have a list of strings that should
> represent the keys in the dictionary. When I try to create a
> dictionary it rearanges the keys. For this dictionary it is realy
> important to keep the right order. Is it possible to arange them in a
> specific order?
> -- 

More information about the Python-list mailing list