Is there any way that I can find the total difference in state between two epochs in a python session?
I'd like to detect changes to any global variables, including any arbitrarily-nested changes (such as reassignments to object attributes and to container elements).
The reason for this is to debug a complicated function which has an unexpected side-effect of interfering with the subsequent behaviour of another function. I'd like to find what changed between before and after that function invocation. (I'm hoping to be presented a summary of changes. I don't want to have to manually trace through all levels of subroutines, looking for variables that will not pass out of scope and are modified and are not subsequently restored to their original values.) I guess I want something akin to a diff of the memory heap, but at a higher level of abstraction. (This could also be helpful when debugging memory leaks.) Is there already anything in the standard library that can assist?