Making a "deep" copy

Oleg Broytmann phd at phd.fep.ru
Mon May 14 10:58:03 EDT 2001


On Mon, 14 May 2001 alex at pad.zuken.de wrote:
> 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?

   You already mentioned "deep" copy! Just do copy.deepcopy(dict) :)

Oleg.
----
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list