In python, when I assign a list to another, like:
a = [1,2,3] b = a
Now b and a point to the same list. Now considering two lists,
Now how is it that they are swapped like any other data type and does not end up both pointing to the same list?
Because the moment you unpack the tuple b, a into the tuple a, b you loose references to the original a and b and they get re-assigned.
b, a
a, b
a
b