Skip to content

Clarify ASYNC119 async generator cleanup - #481

Closed
Boulea7 wants to merge 1 commit into
python-trio:mainfrom
Boulea7:docs/async119-generator-cleanup
Closed

Boulea7 wants to merge 1 commit into
python-trio:mainfrom
Boulea7:docs/async119-generator-cleanup

Conversation

@Boulea7

@Boulea7 Boulea7 commented Dec 3, 2026

Copy link
Copy Markdown

An early exit can leave an async generator suspended inside either kind of context manager. Clarify when cleanup is deferred, what happens at runner shutdown, and how callers can close an iterator promptly with contextlib.aclosing().

Verified early exit and cleanup on asyncio and Trio with Python 3.10 and 3.14. The full Sphinx documentation builds with warnings treated as errors. All 15 targeted tests pass.

Refs #395.

Prepared and reviewed with Codex.

@Zac-HD

Zac-HD commented Dec 3, 2026

Copy link
Copy Markdown
Member

closing; AI-generated contributions are not helpful (we could also ask a model if we wanted them!), and in this case is incorrect in some details too.

@Zac-HD Zac-HD closed this Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants