Commit 9fb67c8
authored
Improve deepcopy documentation to clarify reference behavior (#51569)
The original text here:
> For example, deep-copying an array produces a new array whose elements
are deep copies of the original elements
reads to me that its implementation would do something like
`deepcopy(array) = [deepcopy(element) for element in array]`. That's the
wrong mental model — we preserve relationships. This is tricky to talk
about, but I think this gets at the crux of it.1 parent b790cf8 commit 9fb67c8
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
0 commit comments