[Python-Dev] defaultdict proposal round three (original) (raw)

Alex Martelli aleaxit at gmail.com
Mon Feb 20 22:20:46 CET 2006


On Feb 20, 2006, at 12:33 PM, Guido van Rossum wrote: ...

You don't need a new feature for that use case; d[k] = d.get(k, 0) + 1 is perfectly fine there and hard to improve upon.

I see d[k]+=1 as a substantial improvement -- conceptually more
direct, "I've now seen one more k than I had seen before".

Alex



More information about the Python-Dev mailing list