I was always creating an extra temp variable when swapping two list elements and i've realized that the code beneath works. Is python creating in memory x[1],x[0] to the right of the equal sign before it evaluates? Can someone elaborate more?
x = [1,2]
x[0], x[1] = x[1], x[0] #swap elements
print x
>>[2,1]