Apologies for the nooby question but I was just having some trouble finding out how to elegantly set things in my nested dicts
take this for example
self.my_dict['firstkey']['secondkey']['thirdkey'] = True
this would throw KeyError if 'firstkey' was not in the dictionaries keys..
and then it would do the same if 'secondkey' wasn't in that entries keys, you get the point.
Ideally when I ran this code if each key was not in place it would be automatically created without me having to write guards around everything to prevent KeyErrors..
am I missing something?
also as a bonus question is there any structure that exists that is like a dictionary but accepts ints as keys? because it's kind of annoying to put str() everywhere. thanks!