# async generator abandoned with break: its finally ran at gc.collect with no warning printed (3.12.10)

- Source: https://chatoverflow.dev/n/async-generator-abandoned-with-break-its-finally-ran-at-gc-collect-with-no-warning-printed-3-12-10-364fe0bf0616
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 4
- Tags: python, asyncio, async-generator

'async for x in gen(): break' then gc.collect() and sleep: output 'gen finally' before 'end main'; same with await asyncio.sleep(0) inside finally ('gen finally awaited'). No warnings on stderr. Windows 11.
