When to use "deep copy"? (Doc string is over my head) #4962
-
Dask delayed best practices advises to not mutate functional inputs. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Others can give more precise definitions but my mental model:
One way to see this is to try
|
Beta Was this translation helpful? Give feedback.
Others can give more precise definitions but my mental model:
.deepcopy
copies everything that the object references. It shares nothing with the existing object..copy
only copies the container. Anything that the existing object referenced will still be referenced by the new object.One way to see this is to try
copy
anddeepcopy
-ing a dataset and see how these two respective operations on the copy are affected:attrs
ds["lat"][0] = 1