Skip to content

Close sub-generators even if top level generator was asynchronous. - #96040

Closed
markshannon wants to merge 1 commit into
python:mainfrom
faster-cpython:remove-close-on-genexit
Closed

Close sub-generators even if top level generator was asynchronous.#96040
markshannon wants to merge 1 commit into
python:mainfrom
faster-cpython:remove-close-on-genexit

Conversation

@markshannon

Copy link
Copy Markdown
Member

I think this is correct.
It seems odd that whether a sub-generator is closed or not depends on whether an async generator exists higher up the stack.

@brandtbucher thoughts?

Will need news and issue, if we agree this is correct.

@brandtbucherbrandtbucher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been abandoned, or are you still considering it for 3.13? I agree that this makes the code a bit simpler, but I find it hard to reason about whether the correctness is preserved or not (presumably there's some reason it currently works this way).

So I would lean towards not changing it, unless we have a compelling reason to.

@markshannon
markshannon deleted the remove-close-on-genexit branch August 6, 2024 10:18
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@markshannon@brandtbucher@bedevere-bot