[Python-ideas] Adding "+" and "+=" operators to dict

Carl Meyer carl at oddbird.net
Thu Feb 12 17:57:46 CET 2015


On 02/12/2015 03:43 AM, Steven D'Aprano wrote:
> I think this is a feature that is more useful in theory than in 
> practice. Which we already have a way to do a merge in place, and a 
> copy-and-merge seems like it should be useful but I'm struggling to 
> think of any use-cases for it. I've never needed this, and I've never 
> seen anyone ask how to do this on the tutor or python-list mailing 
> lists.

I think the level of interest in
http://stackoverflow.com/questions/38987/how-can-i-merge-two-python-dictionaries-in-a-single-expression
(almost 1000 upvotes on the question alone) does indicate that the
desire for an expression form of merging dictionaries is not purely
theoretical.

Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150212/b72cfc67/attachment.sig>


More information about the Python-ideas mailing list