Discussion about this post

User's avatar
Zan Tafakari's avatar

This was great - I definitely predicted the title wrong haha. I also recently learned that simultaneous assignment is not perfectly simultaneous!! Keep it up Stephen

Expand full comment
Ash Roberts's avatar

I learned a lot with this one. When you started with talking about being able to change the values in a dictionary in a tuple, my first guess for why was *close*. I figured that the values of the tuples were the dictionary, so as long as the dictionary is still there, the tuple hasn't changed, no matter if changes are made inside the dictionary. But it makes sense that it's not the actual object in the tuple but a reference to it.

But I have a question about reassigning the variable name of a string (or any other immutable type). When you assign the new string to the old string's variable name, what happens to the old string? Is it gone, removed from memory or just hanging out, unreachable until garbage collection?

Expand full comment
9 more comments...

No posts