Skip to content
loading...

re: defaultdicts: Never Check If a Key is Present Again! VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I know dicts are ordered by default from 3.7 onwards (so you could just use defaultdict), but I needed to mix the defaultdict and OrderedDict at on...
 

Neat! My first thought was to wonder if it could be done with multiple inheritance between defaultdict and OrderedDict, but that seems like that could be a big nightmare, so your method is probably cleaner. :)

code of conduct - report abuse