| 726 | raise BoxKeyError(str(err)) from _exception_cause(err) |
| 727 | |
| 728 | def __delattr__(self, item): |
| 729 | if self._box_config["frozen_box"]: |
| 730 | raise BoxError("Box is frozen") |
| 731 | if item == "_box_config": |
| 732 | raise BoxError('"_box_config" is protected') |
| 733 | if item in self._protected_keys: |
| 734 | raise BoxKeyError(f'Key name "{item}" is protected') |
| 735 | |
| 736 | property_fdel = _get_property_func(self, item)[2] |
| 737 | |
| 738 | # if user has customized property deleter, route to it |
| 739 | if property_fdel is not None: |
| 740 | property_fdel(self) |
| 741 | return |
| 742 | try: |
| 743 | self.__delitem__(item) |
| 744 | except KeyError as err: |
| 745 | if self._box_config["conversion_box"]: |
| 746 | safe_key = self._safe_attr(item) |
| 747 | if safe_key in self._box_config["__safe_keys"]: |
| 748 | self.__delitem__(self._box_config["__safe_keys"][safe_key]) |
| 749 | del self._box_config["__safe_keys"][safe_key] |
| 750 | return |
| 751 | raise BoxKeyError(str(err)) from _exception_cause(err) |
| 752 | |
| 753 | def pop(self, key, *args): |
| 754 | if self._box_config["frozen_box"]: |