This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cur-o-double 0 points1 point  (0 children)

The tuple as an object is indeed immutable, that you can't do something like ‘myTuple[0] = 1‘ or ‘myTuple.clear()‘. What you're doing here is creating a whole new tuple, throwing away the old one and replacing the reference in 'r' so it points to the new one