]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-135110: Fix misleading `generator.close()` documentation (GH-135152)
authorConnor Denihan <188690869+cdenihan@users.noreply.github.com>
Thu, 26 Jun 2025 13:27:25 +0000 (09:27 -0400)
committerGitHub <noreply@github.com>
Thu, 26 Jun 2025 13:27:25 +0000 (09:27 -0400)
commit0d76dccc3b4376ba075a1737f58809e3d83aaaa3
tree2a32218dd8dc262dd4bb738e77864585981c0af4
parentfb9e292919d82326acea456aa071c9af6aff5626
gh-135110: Fix misleading `generator.close()` documentation (GH-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.
Doc/howto/functional.rst
Doc/reference/expressions.rst