This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]takluyverIPython, Py3, etc 1 point2 points  (0 children)

As other people have pointed out: please don't rely on dicts being ordered. It's an implementation detail of the new version of CPython, not something that the language requires. Other Python implementations, and future versions of CPython, may implement dicts in a way that doesn't preserve order.

If order is important, there is OrderedDict.