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

Method copy

Lib/weakref.py:141–147  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

139 self.data[key] = KeyedRef(value, self._remove, key)
140
141 def copy(self):
142 new = WeakValueDictionary()
143 for key, wr in self.data.copy().items():
144 o = wr()
145 if o is not None:
146 new[key] = o
147 return new
148
149 __copy__ = copy
150

Callers 3

__or__Method · 0.95
test_weak_valuesMethod · 0.95

Calls 3

WeakValueDictionaryClass · 0.85
itemsMethod · 0.45
copyMethod · 0.45

Tested by 2

test_weak_valuesMethod · 0.76