See the
memory_graph
python package.
Log:
Python Code:
import memory_graph as mg import js def add_one(a, b, c): a += [1] b += (1,) c += [1] print("display a graph of the call stack") js.display(mg.create_graph(mg.get_call_stack())) print("initialize test data") a = [4, 3, 2] b = (4, 3, 2) c = [4, 3, 2] print(f"a:{a} b:{b} c:{c}") print("call function: add_one(a, b, c.copy())") add_one(a, b, c.copy()) print(f"a:{a} b:{b} c:{c}") print("only 'a' has changed, the graph explains why")
Run
Graph:
Output: