]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-135110: Fix misleading `generator.close()` documentation (GH-135152) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 26 Jun 2025 13:34:33 +0000 (15:34 +0200)
committerGitHub <noreply@github.com>
Thu, 26 Jun 2025 13:34:33 +0000 (13:34 +0000)
commitad6c90f5ba2f597d352f1c770a729eba917f131b
treee888210aecf14778882210d13392221fd5152c7a
parent19740b7a7a0cb503d7d593bf8d08408599c07033
[3.14] gh-135110: Fix misleading `generator.close()` documentation (GH-135152) (GH-135985)

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.
(cherry picked from commit 0d76dccc3b4376ba075a1737f58809e3d83aaaa3)

Co-authored-by: Connor Denihan <188690869+cdenihan@users.noreply.github.com>
Doc/howto/functional.rst
Doc/reference/expressions.rst