Yatsek:
> Is there simple way to copy a into b (like a[:]) with all copies of
> all objects going as deep as possible?

If you only want to copy up to level-2, then you can do something
like:
cloned = [subl[:] for subl in somelist]
Or sometimes safer:
cloned = [list(subl) for subl in somelist]

If you want to go all the way down, you can use the deepcopy function
of the copy module. In many situations the level-2 copy may be enough,
and it can be faster.

Bye,
bearophile
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to