| 355 | setattr(instance, key, value) |
| 356 | |
| 357 | def fdel(instance: Any) -> None: |
| 358 | state = attributes.instance_state(instance) |
| 359 | dict_ = attributes.instance_dict(instance) |
| 360 | attr = state.manager[self.key] |
| 361 | |
| 362 | if attr.dispatch._active_history: |
| 363 | previous = fget(instance) |
| 364 | dict_.pop(self.key, None) |
| 365 | else: |
| 366 | previous = dict_.pop(self.key, LoaderCallableStatus.NO_VALUE) |
| 367 | |
| 368 | attr = state.manager[self.key] |
| 369 | attr.dispatch.remove(state, previous, attr.impl) |
| 370 | for key in self._attribute_keys: |
| 371 | setattr(instance, key, None) |
| 372 | |
| 373 | self.descriptor = property(fget, fset, fdel) |
| 374 | |