1👍
✅
Python dicts are unordered. When serializing them, there is no way to predict the order of the key/values pairs.
Try again with an OrderedDict.
Edit:
As of Python 3.6, dicts are ordered by default, this is an implementation detail, not a new standard. Keep using OrderedDict
, it is more explicit, more compatible and future proof.
👤aumo
Source:stackexchange.com