File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44.. module :: copy
55 :synopsis: Shallow and deep copy operations.
66
7+ This module provides generic (shallow and deep) copying operations.
78
8- .. index ::
9- single: copy() (in copy)
10- single: deepcopy() (in copy)
119
12- This module provides generic (shallow and deep) copying operations.
10+ Interface summary:
11+
12+ .. function :: copy(x)
13+
14+ Return a shallow copy of *x *.
15+
16+
17+ .. function :: deepcopy(x)
18+
19+ Return a deep copy of *x *.
1320
14- Interface summary::
1521
16- import copy
22+ .. exception :: error
1723
18- x = copy.copy(y) # make a shallow copy of y
19- x = copy.deepcopy(y) # make a deep copy of y
24+ Raised for module specific errors.
2025
21- For module specific errors, :exc: `copy.error ` is raised.
2226
2327The difference between shallow and deep copying is only relevant for compound
2428objects (objects that contain other objects, like lists or class instances):
You can’t perform that action at this time.
0 commit comments