The latest versions of Python from 3.7 on have a guarantee that the order of items in a dict
will match the insertion order. So the following will always produce the same result:
>>> d = {}
>>> d['a'] = 1
>>> d['b'] = 2
>>> d['c'] = 3
>>> list(d.items())
[('a', 1), ('b', 2), ('c', 3)]
But when you define multiple keys at the same time, is the evaluation order guaranteed to be left to right? A quick test shows that it is, this one time, but is it something that can be relied on?
>>> d = {'z': 26, 'y': 25, 'x': 24}
>>> list(d.items())
[('z', 26), ('y', 25), ('x', 24)]
Something backed by a quote from the official Python documentation or a PEP would be best.