(x, memo, deepcopy=deepcopy)
| 204 | d[dict] = _deepcopy_dict |
| 205 | |
| 206 | def _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) |
| 219 | d[frozendict] = _deepcopy_frozendict |
| 220 | |
| 221 | def _deepcopy_method(x, memo): # Copy instance methods |
nothing calls this directly
no test coverage detected
searching dependent graphs…