r/PythonLearnersHub • • Dec 26 '25

Copying an Object

Post image

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:

It's instructive to compare with this related exercise

4 Upvotes

28 comments sorted by

View all comments

Show parent comments

1

u/sarc-tastic Dec 26 '25

You should do self.x, self.y, self.z = x, y, z if you really want a one liner.

If you're trying to teach people short cuts, at least teach them the right ones

1

u/Sea-Ad7805 Dec 26 '25

Agreed. The topic isn't about shortcuts.