As far as I know there is no official way to clone a list in Python. This is desirable at times because normal variable assignment of lists is just a reference copy. For example: >>> listA = [’A', ‘B’, ‘C’, ‘D’] >>> listB = listA >>> listA [’A', ‘B’, ‘C’, ‘D’] >>> listB [’A', [...]
April 14, 2008 by Isaac
Posted in

content rss
