(self, state: InstanceState[Any], dict_: _InstanceDict)
| 1249 | return value |
| 1250 | |
| 1251 | def delete(self, state: InstanceState[Any], dict_: _InstanceDict) -> None: |
| 1252 | if self.dispatch._active_history: |
| 1253 | old = self.get(state, dict_, PASSIVE_RETURN_NO_VALUE) |
| 1254 | else: |
| 1255 | old = dict_.get(self.key, NO_VALUE) |
| 1256 | |
| 1257 | if self.dispatch.remove: |
| 1258 | self.fire_remove_event(state, dict_, old, self._remove_token) |
| 1259 | state._modified_event(dict_, self, old) |
| 1260 | |
| 1261 | existing = dict_.pop(self.key, NO_VALUE) |
| 1262 | if ( |
| 1263 | existing is NO_VALUE |
| 1264 | and old is NO_VALUE |
| 1265 | and not state.expired |
| 1266 | and self.key not in state.expired_attributes |
| 1267 | ): |
| 1268 | raise AttributeError("%s object does not have a value" % self) |
| 1269 | |
| 1270 | def get_history( |
| 1271 | self, |
nothing calls this directly
no test coverage detected