Lines Matching defs:copy
5 import copy
7 x = copy.copy(y) # make a shallow copy of y
8 x = copy.deepcopy(y) # make a deep copy of y
10 For module specific errors, copy.Error is raised.
16 - A shallow copy constructs a new compound object and then (to the
20 - A deep copy constructs a new compound object and then, recursively,
23 Two problems often exist with deep copy operations that don't exist
24 with shallow copy operations:
29 b) because deep copy copies *everything* it may copy too much, e.g.
33 Python's deep copy operation avoids these problems by:
41 This version does not copy types like module, class, function, method,
64 __all__ = ["Error", "copy", "deepcopy"]
66 def copy(x):
67 """Shallow copy operation on arbitrary Python objects.
118 d[list] = list.copy
119 d[dict] = dict.copy
120 d[set] = set.copy
121 d[bytearray] = bytearray.copy
124 d[PyStringMap] = PyStringMap.copy
129 """Deep copy operation on arbitrary Python objects.
174 # If is its own copy, don't memoize.