Sep-21-2018, 08:08 PM
Say you have a container with memory locations (references) in it.
A normal copy (x = y) just copies the memory location of the container.
A shallow copy (x = y[:]) makes a new container, with the memory locations that were in the old container.
A deep copy (x = deepcopy(y)) makes a new container, with new versions of anything that is just a memory location in the old container.
A normal copy (x = y) just copies the memory location of the container.
A shallow copy (x = y[:]) makes a new container, with the memory locations that were in the old container.
A deep copy (x = deepcopy(y)) makes a new container, with new versions of anything that is just a memory location in the old container.