This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients jimd, rhettinger, serhiy.storchaka
Date 2017-08-20.06:08:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1503209307.78.0.445636353302.issue31240@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-08-20 06:08:27serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, jimd
2017-08-20 06:08:27serhiy.storchakasetmessageid: <1503209307.78.0.445636353302.issue31240@psf.upfronthosting.co.za>
2017-08-20 06:08:27serhiy.storchakalinkissue31240 messages
2017-08-20 06:08:27serhiy.storchakacreate