Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2c1d1d6

Browse files
committed
#15355: Mention already-executing Exception in generator docs.
Patch by Chris Jerdonek.
1 parent 433ef3b commit 2c1d1d6

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Doc/reference/expressions.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,15 @@ called, allowing any pending :keyword:`finally` clauses to execute.
354354

355355
.. index:: object: generator
356356

357-
The following generator's methods can be used to control the execution of a
358-
generator function:
357+
358+
Generator-iterator methods
359+
^^^^^^^^^^^^^^^^^^^^^^^^^^
360+
361+
This subsection describes the methods of a generator iterator. They can
362+
be used to control the execution of a generator function.
363+
364+
Note that calling any of the generator methods below when the generator
365+
is already executing raises a :exc:`ValueError` exception.
359366

360367
.. index:: exception: StopIteration
361368

0 commit comments

Comments
 (0)