Try python 2.7 and above, probably 3.1, there is OrderedDict
http://www.python.org/
http://python.org/download/releases/2.7/
>>> from collections import OrderedDict
>>> d = OrderedDict([('first', 1), ('second', 2),
... ('third', 3)])
>>> d.items()
[('first', 1), ('second', 2), ('third', 3)]
PEP 372: Adding an ordered dictionary to collections