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

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Feb 12 22:56:22 CET 2015


There's an obvious way out of all this. We add
*two* new operators:

    d1 >> d2  #  left operand wins
    d1 << d2  #  right operand wins

And if we really want to do it properly:

    d1 ^ d2   #  raise exception on duplicate keys

-- 
Greg



More information about the Python-ideas mailing list