I'm comparing 2 dictionaries in Python, loadedAgreement
and latestDBAgreement
. I know from this thread that a simple == or != can be used for dictionary comparison.
My dictionaries come out as unequal, and to get the diffs, I used the approach recommended here:
value = { k : second_dict[k] for k in set(second_dict) - set(first_dict) }
from both sides. But when I do this from both sides, both results are empty {}
. So why are the dictionaries still unequal?
diffvalues1 = { k : latestDBAgreement[k] for k in set(latestDBAgreement) - set(loadedAgreement) }
diffvalues2 = { k : loadedAgreement[k] for k in set(loadedAgreement) - set(latestDBAgreement) }
As you can see in the debugger, the code dropped into the !=
section, but both diffs are empty.