2 comments

[ 4.4 ms ] story [ 14.2 ms ] thread
Would defaultdict be appropriate for these situations?
Very good intuition - defauldict seems to be the best option if you have control over the building of the dictionaries and you think missing value handling is in play. I've updated the post to reflect this.