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

Method update

Lib/weakref.py:410–420  ·  view source on GitHub ↗
(self, dict=None, /, **kwargs)

Source from the content-addressed store, hash-verified

408 return self.data.setdefault(ref(key, self._remove),default)
409
410 def update(self, dict=None, /, **kwargs):
411 if kwargs:
412 msg = ("Keyword arguments are not supported: "
413 "cannot create weak reference to 'str' object")
414 raise TypeError(msg)
415 d = self.data
416 if dict is not None:
417 if not hasattr(dict, "items"):
418 dict = type({})(dict)
419 for key, value in dict.items():
420 d[ref(key, self._remove)] = value
421
422 def __ior__(self, other):
423 self.update(other)

Callers 7

__init__Method · 0.95
__ior__Method · 0.95
__or__Method · 0.45
__ror__Method · 0.45
__or__Method · 0.45
__ror__Method · 0.45

Calls 1

itemsMethod · 0.45

Tested by 1