Best way to copy a list in Python

Posted by sheats on Stack Overflow See other posts from Stack Overflow or by sheats
Published on 2008-10-08T20:11:22Z Indexed on 2010/03/21 10:51 UTC
Read the original article Hit count: 128

Filed under:
lst1 = ['one', 2, 3]

// What is the best way of the following  -- or is there another way?
lst2 = list(lst1)
lst2 = lst1[:]

import copy
lst2 = copy.copy(lst1)

© Stack Overflow or respective owner

Related posts about python