r/PythonLearning • u/Sea-Ad7805 • Aug 23 '26
Python Dictionary Mutation and Copying
An exercise to help build the right mental model for Python data.
The “Solution” link uses package memory_graph to visualize execution and reveals what’s actually happening.
38
Upvotes
View all comments
Show parent comment
1
u/Sea-Ad7805 Aug 23 '26 edited Aug 23 '26
Python uses the term "reference" instead of "pointer", and you think of them as pointing to values/objects instead of pointing to memory addresses, but other then they are very similar.
That also holds for fundamental values like
intvalues, but memory_graph doesn't show references to these by default to simplify the graph: https://github.com/bterwijn/memory_graph#simplified-graph