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)
| 4452 | self.dispatch.transient_to_pending(self, state) |
| 4453 | |
| 4454 | def __contains__(self, instance: object) -> bool: |
| 4455 | """Return True if the instance is associated with this session. |
| 4456 | |
| 4457 | The instance may be pending or persistent within the Session for a |
| 4458 | result of True. |
| 4459 | |
| 4460 | """ |
| 4461 | try: |
| 4462 | state = attributes.instance_state(instance) |
| 4463 | except exc.NO_STATE as err: |
| 4464 | raise exc.UnmappedInstanceError(instance) from err |
| 4465 | return self._contains_state(state) |
| 4466 | |
| 4467 | def __iter__(self) -> Iterator[object]: |
| 4468 | """Iterate over all pending or persistent instances within this |
nothing calls this directly
no test coverage detected