(self)
| 779 | self._box_config["__safe_keys"].clear() |
| 780 | |
| 781 | def popitem(self): |
| 782 | if self._box_config["frozen_box"]: |
| 783 | raise BoxError("Box is frozen") |
| 784 | try: |
| 785 | key = next(self.__iter__()) |
| 786 | except StopIteration: |
| 787 | raise BoxKeyError("Empty box") from None |
| 788 | return key, self.pop(key) |
| 789 | |
| 790 | def __repr__(self) -> str: |
| 791 | return f"{self.__class__.__name__}({self})" |