mirror of
https://github.com/python/cpython.git
synced 2025-10-01 04:42:10 +00:00
bpo-29506: Clarify deep copy note in copy module
The reference to administrative data was confusing to readers,
so this simplifies the note to explain that deep copying may copy
more then you intended, such as data that you expected to be
shared between copies.
(cherry picked from commit 19e0494256
)
This commit is contained in:
parent
4c116cb3b3
commit
a524d63072
2 changed files with 3 additions and 2 deletions
|
@ -47,8 +47,8 @@ copy operations:
|
||||||
* Recursive objects (compound objects that, directly or indirectly, contain a
|
* Recursive objects (compound objects that, directly or indirectly, contain a
|
||||||
reference to themselves) may cause a recursive loop.
|
reference to themselves) may cause a recursive loop.
|
||||||
|
|
||||||
* Because deep copy copies *everything* it may copy too much, e.g.,
|
* Because deep copy copies everything it may copy too much, such as data
|
||||||
even administrative data structures that should be shared even between copies.
|
which is intended to be shared between copies.
|
||||||
|
|
||||||
The :func:`deepcopy` function avoids these problems by:
|
The :func:`deepcopy` function avoids these problems by:
|
||||||
|
|
||||||
|
|
|
@ -770,6 +770,7 @@ Lawrence Kesteloot
|
||||||
Vivek Khera
|
Vivek Khera
|
||||||
Dhiru Kholia
|
Dhiru Kholia
|
||||||
Akshit Khurana
|
Akshit Khurana
|
||||||
|
Sanyam Khurana
|
||||||
Mads Kiilerich
|
Mads Kiilerich
|
||||||
Jason Killen
|
Jason Killen
|
||||||
Jan Kim
|
Jan Kim
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue