Expire a state if persistent, else expunge if pending
(
self, state: InstanceState[Any], autoflush: Optional[bool] = None
)
| 3292 | self._conditional_expire(st_) |
| 3293 | |
| 3294 | def _conditional_expire( |
| 3295 | self, state: InstanceState[Any], autoflush: Optional[bool] = None |
| 3296 | ) -> None: |
| 3297 | """Expire a state if persistent, else expunge if pending""" |
| 3298 | |
| 3299 | if state.key: |
| 3300 | state._expire(state.dict, self.identity_map._modified) |
| 3301 | elif state in self._new: |
| 3302 | self._new.pop(state) |
| 3303 | state._detach(self) |
| 3304 | |
| 3305 | def expunge(self, instance: object) -> None: |
| 3306 | """Remove the `instance` from this ``Session``. |
no test coverage detected