I need to efficiently have a diff dictionary that tells me what is the difference between a primary dictionary at some point at time, and now.
I need to have the full path to what is changed, not just the value that changed.
for example:
primary_dict = {'a': 5, 'b':{'c': 9}, 'd':10}
and the difference will be
diff_dict = {'a':6, 'b':{'c':8}}
to say that currently
primary_dict = {'a':6, 'b':{'c':8}, 'd':10}
I can have the diff created when values are added to the dict
I have looked online but only found comparisons between 2 dictionaries and that would inefficient because the dictionary I need to diff is massive and saving it 2 times and diffing it all recursively seems to much work for the problem at hand
EDIT: Changed the question to be more on point. like I have been notified the question that reflects my need is: How do I get changes to a dictionary over time without creating a new variable? Thank you to @CristiFati and @Vishnudev for the corrections