Python list slice syntax used for no obvious reason

Posted by Charles Anderson on Stack Overflow See other posts from Stack Overflow or by Charles Anderson
Published on 2008-11-27T12:57:05Z Indexed on 2010/05/20 8:40 UTC
Read the original article Hit count: 280

Filed under:
|
|

I occasionally see the list slice syntax used in Python code like this:

newList = oldList[:]

Surely this is just the same as:

newList = oldList

Or am I missing something?

© Stack Overflow or respective owner

Related posts about python

Related posts about list