
March 8, 2019
7:19 p.m.
On 2019-03-08 16:55, Guido van Rossum wrote: [snip]
If we were to use "|" and "&" for dict "union" and "intersection", the mutual distributive properties will hold.
Since "|" (especially "|=") *is* suitable for "update", I think we should reserve "+" for some future commutative extension.
One argument is that sets have an update() method aliased to "|=", so this makes it more reasonable to do the same for dicts, which also have a. update() method, with similar behavior (not surprising, since sets were modeled after dicts).
[snip] One way to think of it is that a dict is like a set, except that each of its members has an additional associated value.