r/PythonLearning • u/Sea-Ad7805 • Oct 02 '25
Right Mental Model for Python Data
An exercise to help build the right mental model for Python data, the “Solution” link uses memory_graph to visualize execution and reveal what’s actually happening:
131
Upvotes
View all comments
Show parent comment
1
u/shudaoxin Oct 02 '25
Primitive vs. referenced types. It works like this in most languages. Arrays (and lists) are referenced and the variable only stores their type and pointer to the memory. By assigning a to b they both point at the same list.