Im parsing a complex json string and am working with nested dictionaries and some nested dic.get() functions in my class.
Instead of receiving a None when a higher level key doesn't exist, I would like to find an empty dictionary so that my code (dict.get()) keeps working.
Right now I would like to replace all dictionary values named None with an empty dictionary {}, but I didn't find any good solution how to do it.
So basically I want this:
{'a': {},
'b': 'Text',
'c': 5,
'd': {'d1': {}}
but sadly have that:
{'a': None,
'b': 'Text',
'c': 5,
'd': {'d1': None}