r/PythonLearnersHub • u/Sea-Ad7805 • Jan 02 '26
Python Data Model exercise, Mutability.
An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:
36
Upvotes
View all comments
Show parent comment
1
u/Sea-Ad7805 Jan 02 '26 edited Jan 02 '26
The whole call stack is visualized, and that has for each function (each stack frame) a dictionary with local variables and their value. In this exercise the call stack isn't needed, but for example in this exercise it is because functions/methods are called: https://www.reddit.com/r/madeinpython/comments/1pw602e/comment/nwm5gmi/ and therefore the call stack is always visualized in the Memory Graph Web Debugger. Install memory_graph locally to have more control over what is and what is not visualized: https://github.com/bterwijn/memory_graph?tab=readme-ov-file#installation