3 ms·
I didn't know about defaultdict. The setdefault method was clunky, but that looks really clean.
by ivankirigin 18y ago
I didn't know about defaultdict. The setdefault method was clunky, but that looks really clean.
- newt0311 18y agoDefaultdict and friends were one of the benefits of completing the object model of python. It is made by subclassing userdict and effective.