[Python-ideas] Adding "+" and "+=" operators to dict
Ron Adam
ron3200 at gmail.com
Mon Feb 16 00:51:56 CET 2015
On 02/15/2015 05:14 PM, Neil Girdhar wrote:
> I'm also +1, I agree with Donald that "|" makes more sense to me than "+"
> if only for consistency with sets. In mathematics a mapping is a set of
> pairs (preimage, postimage), and we are taking the union of these sets.
An option might be to allow a union "|" if both the (key, value) pairs that
match in each are the same. Other wise, raise an exception.
Ron
More information about the Python-ideas
mailing list