Skip to content

Instantly share code, notes, and snippets.

@Nimrod0901
Created May 7, 2019 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nimrod0901/6e1db3376bce2c258d17b702ef264a99 to your computer and use it in GitHub Desktop.
Save Nimrod0901/6e1db3376bce2c258d17b702ef264a99 to your computer and use it in GitHub Desktop.
Fast Diff Two Dicts
def diff(fst, sct):
sub = [key: sct[key] for key in set(sct) - set(fst)]
add = [key: sct[key] for key in set(fst) - set(scd)]
print("+:{} \n -:{}".format(add, sub))
return add, sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment