Thanks for the explanation!
Oh right. As far as I know a Python dict in <=3.5 was implemented using a hash function.
In 3.7 the ordering seems to be a mandatory 8.
However, if you don’t want to rely on the version, you could also use an OrderedDict.