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

Method __ror__

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

Source from the content-addressed store, hash-verified

457 return new_box
458
459 def __ror__(self, other: Mapping[Any, Any]):
460 if not isinstance(other, dict):
461 raise BoxTypeError("Box can only merge two boxes or a box and a dictionary.")
462 new_box = other.copy() if isinstance(other, Box) else self.__new_from_plain(other)
463 new_box._box_config["frozen_box"] = False # type: ignore[attr-defined]
464 new_box.update(self) # type: ignore[attr-defined]
465 new_box._box_config["frozen_box"] = self._box_config["frozen_box"] # type: ignore[attr-defined]
466 return new_box
467
468 def __ior__(self, other: Mapping[Any, Any]): # type: ignore[override]
469 if not isinstance(other, dict):

Callers 2

test_ror_boxesMethod · 0.95

Calls 4

__new_from_plainMethod · 0.95
BoxTypeErrorClass · 0.90
copyMethod · 0.45
updateMethod · 0.45

Tested by 2

test_ror_boxesMethod · 0.76