Message300598
The advantage of dict.setdefault() is its atomicity. With lazy evaluation of the value it can't be atomic anymore, and can be replaced with the following code:
if key not in mydict:
mydict[key] = value
I'm -1 for this change. It increases complexity (both semantical and implementational) of dict.setdefault() and doesn't have significant benefit. |
|
Date |
User |
Action |
Args |
2017-08-20 06:08:27 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, jimd |
2017-08-20 06:08:27 | serhiy.storchaka | set | messageid: <1503209307.78.0.445636353302.issue31240@psf.upfronthosting.co.za> |
2017-08-20 06:08:27 | serhiy.storchaka | link | issue31240 messages |
2017-08-20 06:08:27 | serhiy.storchaka | create | |
|