SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

0 0 1 Python

bpo-29957: change LBYL key lookup to dict.setdefault (#938)

* change LBYL key lookup to dict.setdefault

The ``results`` was constructed as a defaultdict and we could simply
delete the check ``if key not in results``. However, I think it's safer
to use dict.setdefault as I'm not sure whether the caller expects a
regular dict or defaultdict.

* add name to the acknowledgements file

* use defaultdict to make the key-lookup cleaner
M
Michael Selik committed
11fa3c7cd1b151e302d4eee0369cafbaf151c8fb
Parent: 64c887a
Committed by Benjamin Peterson <benjamin@python.org> on 4/2/2017, 6:02:31 AM