How do I create an ordered dictionary key from a tuple in Python 2.7?
I have seen a lot of examples about creating a new dictionary from a tuple, or building tuples from dictionary keys but not how to generate a "multi-dimensional key" from a tuple, i.e. use the keys in the tuple to recursively index into a nested dictionary.
Basically I would like to use a tuple such as:
('australia', 'queensland', 'brisbane')
as a dictionary key:
places['australia']['queensland']['brisbane']
The dictionary is an OrderedDict that contains JSON data.
placesis a dict of dicts of dicts? - Andras Deak