What's the cleanest way to compare 2 dictionary?

John Henry john106henry at hotmail.com
Wed Aug 9 14:17:30 EDT 2006


Hi list,

I am sure there are many ways of doing comparision but I like to see
what you would do if you have 2 dictionary sets (containing lots of
data - like 20000 keys and each key contains a dozen or so of records)
and you want to build a list of differences about these two sets.

I like to end up with 3 lists: what's in A and not in B, what's in B
and not in A, and of course, what's in both A and B.

What do you think is the cleanest way to do it?  (I am sure you will
come up with ways that astonishes me  :=) )

Thanks,




More information about the Python-list mailing list