I am using default dict. I need to pprint.
pprint
However, when I pprint ...this is how it looks.
defaultdict(
If you don't have to use pprint, you can use json to pretty-print the defaultdict:
json
defaultdict
print(json.dumps(my_default_dict, indent=4))
This also works for nested defaultdicts.