A case of extracting the diff of 2 dict
s in Python
# DICT DIFF EXAMPLE
data = {
"fee": 1,
"fi": 2,
"fo": 3,
"fum": 4,
}
new_data = {
"fee": 1,
"fi": "2",
"fo": {
"foo": "bar"
},
"fum": 4,
}
diff = {k: v for k, v in new_data.items() if v not in data.values()}
print(diff)