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

Method __deepcopy__

Lib/weakref.py:347–354  ·  view source on GitHub ↗
(self, memo)

Source from the content-addressed store, hash-verified

345 __copy__ = copy
346
347 def __deepcopy__(self, memo):
348 from copy import deepcopy
349 new = self.__class__()
350 for key, value in self.data.copy().items():
351 o = key()
352 if o is not None:
353 new[o] = deepcopy(value, memo)
354 return new
355
356 def get(self, key, default=None):
357 return self.data.get(ref(key),default)

Callers

nothing calls this directly

Calls 4

deepcopyFunction · 0.90
__class__Method · 0.45
itemsMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected