
* M.-A. Lemburg <mal@egenix.com> [2015-02-12 09:51:22 +0100]:
However, I don't really see the point in having an operation that takes two dictionaries, creates a new empty one and updates this with both sides of the operand. It may be theoretically useful, but it results in the same poor performance you have in string concatenation.
In applications, you normally just need the update functionality for dictionaries. If you do need a copy, you can create a copy explicitly - but those cases are usually rare.
So +1 on the '+=' syntax, -1 on '+' for dicts.
I think it'd be rather confusing if += works but + does not. Regarding duplicate keys, IMHO only two options make sense: 1) Raise an exception 2) The right-hand side overrides keys in the left-hand side. I think #1 would prevent many useful cases where + could be used instead of .update(), so +1 for #2. Florian -- http://www.the-compiler.org | me@the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc I love long mails! | http://email.is-not-s.ms/