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

Method __or__

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

Source from the content-addressed store, hash-verified

334 return self
335
336 def __or__(self, other: Mapping[Any, Any]):
337 if not isinstance(other, dict):
338 raise BoxTypeError("Box can only merge two boxes or a box and a dictionary.")
339 new_box = self.copy()
340 new_box._box_config["frozen_box"] = False
341 new_box.update(other) # type: ignore[attr-defined]
342 new_box._box_config["frozen_box"] = self._box_config["frozen_box"]
343 return new_box
344
345 def __ror__(self, other: Mapping[Any, Any]):
346 if not isinstance(other, dict):

Callers

nothing calls this directly

Calls 3

copyMethod · 0.95
BoxTypeErrorClass · 0.90
updateMethod · 0.80

Tested by

no test coverage detected