Ok so I can use an OrderedDict in json.dump. That is, an OrderedDict can be used as an input to JSON.
json.dump
But can it be used as an output? If so how? In my
The normally used load command will work if you specify the object_pairs_hook parameter:
import json from collections import OrderedDict with open('foo.json', 'r') as fp: metrics_types = json.load(fp, object_pairs_hook=OrderedDict)