| 430 | return copyreg.__newobj__, (self.__class__,), state |
| 431 | |
| 432 | def __setstate__(self, state): |
| 433 | if "items" not in state: |
| 434 | # Pickled by Box 7 or earlier: the items were already appended |
| 435 | self.__dict__.update(state) |
| 436 | return |
| 437 | self.__init__(state["items"], **state["box_options"]) |
| 438 | for name in ("_box_comments", "_box_comments_document"): |
| 439 | if name in state: |
| 440 | self.__dict__[name] = state[name] |
| 441 | |
| 442 | def __hash__(self) -> int: # type: ignore[override] |
| 443 | if self.box_options.get("frozen_box"): |