MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / __iter__

Method __iter__

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

Source from the content-addressed store, hash-verified

2847 return None
2848
2849 def __iter__(self) -> Iterator[_T]:
2850 result = self._iter()
2851 try:
2852 yield from result # type: ignore
2853 except GeneratorExit:
2854 # issue #8710 - direct iteration is not reusable after
2855 # an iterable block is broken, so close the result
2856 result._soft_close()
2857 raise
2858
2859 def _iter(self) -> Union[ScalarResult[_T], Result[_T]]:
2860 # new style execution.

Callers

nothing calls this directly

Calls 2

_iterMethod · 0.95
_soft_closeMethod · 0.45

Tested by

no test coverage detected