Python 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:

21 points · 6 comments · view on lemmy.world

6 Comments

joyjoy@lemmy.zip · 3 pts · 297d (3 replies)

It's always fun to guess whether python will call __add__ or __iadd__.

Valmond@lemmy.world · 1 pts · 297d (1 reply)

I so wonder what a will result in.

bterwijn@programming.dev · 1 pts · 297d

Yes a you get for free to set the tone, the others are more interesting.