Making a "deep" copy

Remco Gerlich scarblac at pino.selwerd.nl
Mon May 14 10:51:06 EDT 2001


alex at pad.zuken.de <alex at pad.zuken.de> wrote in comp.lang.python:
> 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? 

import copy
copy.deepcopy(dict)

-- 
Remco Gerlich



More information about the Python-list mailing list