[Python-ideas] Adding "+" and "+=" operators to dict
Stefan Behnel
stefan_ml at behnel.de
Fri Feb 13 11:11:59 CET 2015
Greg Ewing schrieb am 12.02.2015 um 22:24:
> my main objection to an asymmetrical + for dicts
> is that it would be difficult to remember which way
> it went.
>
> Analogy with bytes + sequence would suggest that the
> left operand wins. Analogy with dict.update would
> suggest that the right operand winds.
Do you really think that's an issue? Arithmetic expressions are always
evaluated from left to right. It thus seems obvious to me what gets created
first, and what gets added afterwards (and overwrites what's there).
Stefan
More information about the Python-ideas
mailing list