mirror of
https://github.com/python/cpython.git
synced 2025-10-02 21:25:24 +00:00
gh-100201: Document behavior with a bare yield
statement (GH-100416)
(cherry picked from commit 1aab269d4a
)
Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
This commit is contained in:
parent
c7dcfdaef6
commit
18ccb84697
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue