In the official Python Tutorial (2.7), it is said that slice makes a shallow copy of the list (for eg) and each item in a slice is a reference to the original list object.
For eg, doing
a = [1,2,3]
a[:][0] = 2
will not change the actual value cause what happens is merely the first item in the slice is referenced to a new object (which is 2).
However, doing
a[:] = [] # or any other list
will actually change the list.
Can anybody explain that?