diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -377,8 +377,15 @@ .. index:: object: generator -The following generator's methods can be used to control the execution of a -generator function: + +Generator-iterator methods +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This subsection describes the methods of a generator iterator. They can +be used to control the execution of a generator function. + +Note that calling any generator method when the generator is already +executing raises an exception. .. index:: exception: StopIteration diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -191,6 +191,9 @@ Documentation ------------- +- Issue #15355: Document that calling a generator method when the generator + is already executing raises an exception. Patch by Chris Jerdonek. + - Issue #15230: Clearly document some of the limitations of the runpy module and nudge readers towards importlib when appropriate.