News for hackers. Stuff that matters.
Re:Python: copying a list the right way by d0mine on Sunday November 06, 2011 @01:02AM (#3201901)
You can't say just looking at b[:] that its creates a copy unless you know its type e.g., if `b` is a numpy array then it doesn't copy the data and by changing b[i] you change a[i].

list(a), copy.copy(a) are more explicit.

There are no comments on this comment yet.