I Have two dictionary and i want to compare them to understand which item added or deleted or modified it's value.
I write a class for doing compare two dict.
class CompareTwoDict:
def __init__(self, dict1, dict2) -> None:
self._dict1 = dict1
self._dict2 = dict2
def added_from_dict1(self):
...
def deleted_from_dict1(self):
...
def modified_from_dict1(self):
...
def common_between_dict1_dict2(self):
...
added_from_dict1 means any item in dict2 that is not in dict1.
deleted_from_dict1 means any item in dict1 but it is not in dict2.
modified_from_dict1 means item's value change in dict2.
common_between_dict1_dict2 means items in dict1 and dict2 have the same key and value.
Is There any python standard function do it?