Created
May 7, 2019 17:22
-
-
Save Nimrod0901/6e1db3376bce2c258d17b702ef264a99 to your computer and use it in GitHub Desktop.
Fast Diff Two Dicts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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