Modifying the {} and [] tokens

Roy Smith roy at panix.com
Sat Aug 23 12:40:05 EDT 2003


Geoff Howland <ghowland at lupineNO.SPAMgames.com> wrote:
> {} + {} is not allowed.

What would it mean?  What would you do if you had two dicts:

d1 = {'a':1, 'b':2}
d2 = {'a':42}

what would the value of (d1+d2)['a'] be?




More information about the Python-list mailing list