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

Method __radd__

box/box.py:319–328  ·  view source on GitHub ↗
(self, other: Mapping[Any, Any])

Source from the content-addressed store, hash-verified

317 return new_box
318
319 def __radd__(self, other: Mapping[Any, Any]):
320 if not isinstance(other, dict):
321 raise BoxTypeError("Box can only merge two boxes or a box and a dictionary.")
322
323 new_box = other.copy()
324 if not isinstance(other, Box):
325 new_box = self._box_config["box_class"](new_box)
326 new_box.merge_update(self, _force_unfrozen=True) # type: ignore[attr-defined]
327 new_box._box_config["frozen_box"] = self._box_config["frozen_box"] # type: ignore[attr-defined]
328 return new_box
329
330 def __iadd__(self, other: Mapping[Any, Any]):
331 if not isinstance(other, dict):

Callers

nothing calls this directly

Calls 3

BoxTypeErrorClass · 0.90
merge_updateMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected