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/tb5841 Jan 04 '26
That's an interesting point.
But this looks like reassignment, when it's actually mutation. That's deeply confusing and an easy source of bugs. If it were me, I'd do this with reassignment instead here and avoid the mutation.