MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __iter__

Method __iter__

lib/sqlalchemy/orm/query.py:2906–2914  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2904 return None
2905
2906 def __iter__(self) -> Iterator[_T]:
2907 result = self._iter()
2908 try:
2909 yield from result # type: ignore
2910 except GeneratorExit:
2911 # issue #8710 - direct iteration is not reusable after
2912 # an iterable block is broken, so close the result
2913 result._soft_close()
2914 raise
2915
2916 def _iter(self) -> Union[ScalarResult[_T], Result[_T]]:
2917 # new style execution.

Callers

nothing calls this directly

Calls 2

_iterMethod · 0.95
_soft_closeMethod · 0.45

Tested by

no test coverage detected