> Anyone who has read the code will understand the expected behaviour.

It was not obvious for me (with years of Python experience) and I've never seen this before. So an additional comment like "ensure the key is in the defaultdict" wouldn't harm anyone, right? :)