Serhiy Storchaka added the comment:
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.
----------
nosy: +rhettinger, serhiy.storchaka
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue31240>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com