Making a "deep" copy

Alex Martelli aleaxit at yahoo.com
Mon May 14 10:51:00 EDT 2001


[Posted AND mailed]

<alex at pad.zuken.de> wrote in message news:3AFFEE8A.1DAF14D2 at pad.zuken.de...
> Hi!
>
> I've got a dictionary which contains lists and other dictionaries.
> I want to create a real copy, but dict.copy() only copies the first
> "layer". Is there a (fast) way to do this?
>
> Please use email for ideas. Thanks.

import copy
copy.deepcopy(dict)


Alex






More information about the Python-list mailing list