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

Method __ror__

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

Source from the content-addressed store, hash-verified

343 return new_box
344
345 def __ror__(self, other: Mapping[Any, Any]):
346 if not isinstance(other, dict):
347 raise BoxTypeError("Box can only merge two boxes or a box and a dictionary.")
348 new_box = other.copy()
349 if not isinstance(other, Box):
350 new_box = self._box_config["box_class"](new_box)
351 new_box._box_config["frozen_box"] = False # type: ignore[attr-defined]
352 new_box.update(self) # type: ignore[attr-defined]
353 new_box._box_config["frozen_box"] = self._box_config["frozen_box"] # type: ignore[attr-defined]
354 return new_box
355
356 def __ior__(self, other: Mapping[Any, Any]): # type: ignore[override]
357 if not isinstance(other, dict):

Callers 1

test_ror_boxesMethod · 0.95

Calls 3

BoxTypeErrorClass · 0.90
updateMethod · 0.80
copyMethod · 0.45

Tested by 1

test_ror_boxesMethod · 0.76