MCPcopy Create free account
hub / github.com/cdgriffith/Box / update

Method update

box/box.py:820–834  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

818 return out_dict
819
820 def update(self, *args, **kwargs):
821 if self._box_config["frozen_box"]:
822 raise BoxError("Box is frozen")
823 if (len(args) + int(bool(kwargs))) > 1:
824 raise BoxTypeError(f"update expected at most 1 argument, got {len(args) + int(bool(kwargs))}")
825 single_arg = next(iter(args), None)
826 if single_arg:
827 if hasattr(single_arg, "keys"):
828 for k in single_arg:
829 self.__convert_and_store(k, single_arg[k])
830 else:
831 for k, v in single_arg:
832 self.__convert_and_store(k, v)
833 for k in kwargs:
834 self.__convert_and_store(k, kwargs[k])
835
836 def merge_update(self, *args, **kwargs):
837 merge_type = None

Callers 14

test_updateMethod · 0.95
test_frozenMethod · 0.95
__ior__Method · 0.95
common.pyFile · 0.80
__new__Method · 0.80
_convertMethod · 0.80
__new__Method · 0.80
__init__Method · 0.80
__or__Method · 0.80
__ror__Method · 0.80

Calls 3

__convert_and_storeMethod · 0.95
BoxErrorClass · 0.90
BoxTypeErrorClass · 0.90

Tested by 4

test_updateMethod · 0.76
test_frozenMethod · 0.76