8000 [3.14] gh-135110: Fix misleading `generator.close()` documentation (GH-135152) by miss-islington · Pull Request #135985 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

8000 [3.14] gh-135110: Fix misleading generator.close() documentation (GH-135152) #135985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025

Conversation

miss-islington
Copy link
Contributor
@miss-islington miss-islington commented Jun 26, 2025

The documentation incorrectly stated that generator.close() 'raises' a
GeneratorExit exception. This was misleading because the method doesn't
raise the exception to the caller - it sends the exception internally
to the generator and returns None.
(cherry picked from commit 0d76dcc)

Co-authored-by: Connor Denihan 188690869+cdenihan@users.noreply.github.com


📚 Documentation preview 📚: https://cpython-previews--135985.org.readthedocs.build/

…thonGH-135152)

The documentation incorrectly stated that generator.close() 'raises' a
GeneratorExit exception. This was misleading because the method doesn't
raise the exception to the caller - it sends the exception internally
to the generator and returns None.
(cherry picked from commit 0d76dcc)

Co-authored-by: Connor Denihan <188690869+cdenihan@users.noreply.github.com>
@ZeroIntensity ZeroIntensity enabled auto-merge (squash) June 26, 2025 13:29
@ZeroIntensity ZeroIntensity merged commit ad6c90f into python:3.14 Jun 26, 2025
37 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants
0