summaryrefslogtreecommitdiffstats
path: root/Doc/reference
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-01-01 15:42:31 (GMT)
committerGitHub <noreply@github.com>2023-01-01 15:42:31 (GMT)
commitfd108e5439e8cf3481e7f836aa0fb5622f57d551 (patch)
treeb8fee0ceb4063adeb917b1a0f6b29454359bf65a /Doc/reference
parente3b303a020eaf12dcec4db8bb2b0fb354a14cb68 (diff)
downloadcpython-fd108e5439e8cf3481e7f836aa0fb5622f57d551.zip
cpython-fd108e5439e8cf3481e7f836aa0fb5622f57d551.tar.gz
cpython-fd108e5439e8cf3481e7f836aa0fb5622f57d551.tar.bz2
gh-100201: Document behavior with a bare `yield` statement (GH-100416)
(cherry picked from commit 1aab269d4acbf0b29573ad0a21c54fddee233243) Co-authored-by: ram vikram singh <ramvikrams243@gmail.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/expressions.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 60c3407..21cca5bf 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -449,7 +449,9 @@ generator. That generator then controls the execution of the generator
function. The execution starts when one of the generator's methods is called.
At that time, the execution proceeds to the first yield expression, where it is
suspended again, returning the value of :token:`~python-grammar:expression_list`
-to the generator's caller. By suspended, we mean that all local state is
+to the generator's caller,
+or ``None`` if :token:`~python-grammer:expression_list` is omitted.
+By suspended, we mean that all local state is
retained, including the current bindings of local variables, the instruction
pointer, the internal evaluation stack, and the state of any exception handling.
When the execution is resumed by calling one of the generator's methods, the