MCPcopy Index your code
hub / github.com/python/cpython / _deepcopy_frozendict

Function _deepcopy_frozendict

Lib/copy.py:206–218  ·  view source on GitHub ↗
(x, memo, deepcopy=deepcopy)

Source from the content-addressed store, hash-verified

204d[dict] = _deepcopy_dict
205
206def _deepcopy_frozendict(x, memo, deepcopy=deepcopy):
207 y = {}
208 for key, value in x.items():
209 y[deepcopy(key, memo)] = deepcopy(value, memo)
210
211 # We're not going to put the frozendict in the memo, but it's still
212 # important we check for it, in case the frozendict contains recursive
213 # mutable structures.
214 try:
215 return memo[id(x)]
216 except KeyError:
217 pass
218 return frozendict(y)
219d[frozendict] = _deepcopy_frozendict
220
221def _deepcopy_method(x, memo): # Copy instance methods

Callers

nothing calls this directly

Calls 4

idFunction · 0.85
frozendictClass · 0.85
deepcopyFunction · 0.70
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…