On copying arrays

ernesto.adorio at gmail.com ernesto.adorio at gmail.com
Sun Mar 23 17:26:33 EDT 2008


Is there a conceptual difference between
    best =test[:]
and
   best = [x for x in test] ?
test is a list of real numbers. Had to use the second form to avoid a
nasty bug
in a program I am writing. I have to add too that I was using psyco
in Python 2.5.1.

Regards,
Ernie.



More information about the Python-list mailing list