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

Method __ror__

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

Source from the content-addressed store, hash-verified

448 return new_box
449
450 def __ror__(self, other: Mapping[Any, Any]):
451 if not isinstance(other, dict):
452 raise BoxTypeError("Box can only merge two boxes or a box and a dictionary.")
453 new_box = other.copy() if isinstance(other, Box) else self.__new_from_plain(other)
454 new_box._box_config["frozen_box"] = False # type: ignore[attr-defined]
455 new_box.update(self) # type: ignore[attr-defined]
456 new_box._box_config["frozen_box"] = self._box_config["frozen_box"] # type: ignore[attr-defined]
457 return new_box
458
459 def __ior__(self, other: Mapping[Any, Any]): # type: ignore[override]
460 if not isinstance(other, dict):

Callers 2

test_ror_boxesMethod · 0.95

Calls 4

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

Tested by 2

test_ror_boxesMethod · 0.76