[Python-ideas] PEP: Dict addition and subtraction

Brandt Bucher brandtbucher at gmail.com
Thu Mar 21 14:43:42 EDT 2019


I'd also like to add what I consider to be another point in favor of an
operator:

Throughout all of these related threads, I have seen many typos and
misspellings of current dict merging idioms, from messing up the number of
asterisks in "{**a, **b}", to even Guido(!) accidentally writing the common
copy/update idiom as

d = d1.copy()
d = d1.update(d2)

in a thoughtful email... and it was then copied-and-pasted (unquoted and
verbatim) by others!

I still have yet to see somebody (even those who claim to be confused by
it) mess up the PEP's current definition of "+" or "+=" in this context.

Brandt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190321/c1c5ad9e/attachment.html>


More information about the Python-ideas mailing list