Comparing two Python dictionaries ignores the order of items. If you want to consider the order of items, use OrderedDict instead.
OrderedDict
My previous tips on collections.
Hydra: YAML-Based Config Management Made Simple
Loguru: Configure Professional Logging in a Single Line
Simplifying Type Annotations with MonkeyType