News for hackers. Stuff that matters.
Re:PEP 572: Python assignment expressions has been accepted by sametmax on Tuesday July 03, 2018 @06:42AM (#17449051)
Don't wait for 3.8, and don't bother with defaultdict.

collections.Counter is what you want for the counting case.

dict.get() + dict.setdefault() for the general case.

defaultdict is only useful if the factory is expensive to call.

There are no comments on this comment yet.