Skip to content

Instantly share code, notes, and snippets.

@reuven
Created November 6, 2016 12:02
Show Gist options
  • Save reuven/f73ce40abcdfbf097c6033b64b69302a to your computer and use it in GitHub Desktop.
Save reuven/f73ce40abcdfbf097c6033b64b69302a to your computer and use it in GitHub Desktop.
d1 = {'a':1, 'b':2, 'c':3}
d2 = {'a':1, 'b':2, 'c':4}
print(dictdiff(d1, d1))
# prints {}
print(dictdiff(d1, d2))
# prints {'c': [3, 4]}
d1 = {'a':1, 'b':2, 'd':3}
d2 = {'a':1, 'b':2, 'c':4}
print(dictdiff(d1, d2))
# prints {'c': [None, 4], 'd': [3, None]}
d1 = {'a':1, 'b':2, 'c':3}
d2 = {'a':1, 'b':2, 'd':4}
print(dictdiff(d1, d2))
# prints {'c': [3, None], 'd': [None, 4]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment