| 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): |