MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _deepcopy_tuple

Function _deepcopy_tuple

tools/python-3.11.9-amd64/Lib/copy.py:210–224  ·  view source on GitHub ↗
(x, memo, deepcopy=deepcopy)

Source from the content-addressed store, hash-verified

208d[list] = _deepcopy_list
209
210def _deepcopy_tuple(x, memo, deepcopy=deepcopy):
211 y = [deepcopy(a, memo) for a in x]
212 # We're not going to put the tuple in the memo, but it's still important we
213 # check for it, in case the tuple contains recursive mutable structures.
214 try:
215 return memo[id(x)]
216 except KeyError:
217 pass
218 for k, j in zip(x, y):
219 if k is not j:
220 y = tuple(y)
221 break
222 else:
223 y = x
224 return y
225d[tuple] = _deepcopy_tuple
226
227def _deepcopy_dict(x, memo, deepcopy=deepcopy):

Callers

nothing calls this directly

Calls 3

deepcopyFunction · 0.85
tupleClass · 0.85
idFunction · 0.50

Tested by

no test coverage detected