decouple copy of a list

nn pruebauno at latinmail.com
Fri Dec 10 11:29:38 EST 2010


On Dec 10, 8:48 am, Dirk Nachbar <dirk... at gmail.com> wrote:
> I want to take a copy of a list a
>
> b=a
>
> and then do things with b which don't affect a.
>
> How can I do this?
>
> Dirk

Not knowing the particulars,
you may have to use:

import copy
b=copy.deepcopy(a)



More information about the Python-list mailing list