Return True if the instance is associated with this session. The instance may be pending or persistent within the Session for a result of True.
(self, instance: object)
| 4296 | self.dispatch.transient_to_pending(self, state) |
| 4297 | |
| 4298 | def __contains__(self, instance: object) -> bool: |
| 4299 | """Return True if the instance is associated with this session. |
| 4300 | |
| 4301 | The instance may be pending or persistent within the Session for a |
| 4302 | result of True. |
| 4303 | |
| 4304 | """ |
| 4305 | try: |
| 4306 | state = attributes.instance_state(instance) |
| 4307 | except exc.NO_STATE as err: |
| 4308 | raise exc.UnmappedInstanceError(instance) from err |
| 4309 | return self._contains_state(state) |
| 4310 | |
| 4311 | def __iter__(self) -> Iterator[object]: |
| 4312 | """Iterate over all pending or persistent instances within this |
nothing calls this directly
no test coverage detected