intersection, union, difference, symmetric difference for dictionaries

Skip Montanaro skip at pobox.com
Tue Feb 25 21:40:54 CET 2014


On Tue, Feb 25, 2014 at 2:32 PM, mauro <mauro at gmail.com> wrote:
> So I wonder why operations such us intersection, union, difference,
> symmetric difference that are available for sets and are not available
> for dictionaries without going via key dictviews.

What's the correct result of evaluating this expression?

{'A': 1} | {'A': 2}

I can see (at least) two possible "correct" answers.

Skip



More information about the Python-list mailing list