deep copy

Lou Kates (louk@research.teleride.on.ca)
Thu, 25 Jun 92 22:02:53 EDT

Suppose a is a list and we wish b to have a copy of a such that
if a is later modified b still retains the original value of a
that it had when it was copied.

>>> b = a

won't work since b just points to a; however,

>>> b = a[:]

seems to work as long as the elements of a are not themselves
lists. In this last case even this does not work.

Is there some easy way to copy a into b as desired?

-- 
Lou Kates, louk@research.teleride.on.ca