From 18ccb846970a808e6a46e4cd5779f7719cc4752a Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sun, 1 Jan 2023 07:44:27 -0800 Subject: [PATCH] gh-100201: Document behavior with a bare `yield` statement (GH-100416) (cherry picked from commit 1aab269d4acbf0b29573ad0a21c54fddee233243) Co-authored-by: ram vikram singh Co-authored-by: C.A.M. Gerlach --- Doc/reference/expressions.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 0cdf91e75b3..655d19969a5 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -454,7 +454,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