@@ -784,12 +784,12 @@ Generator functions
784784 single: generator; function
785785 single: generator; iterator
786786
787- A function or method which uses the :keyword: `yield ` statement (see section
788- :ref: `yield `) is called a :dfn: `generator function `. Such a function, when
787+ A function or method which contains a :keyword: `yield ` expression (see section
788+ :ref: `yieldexpr `) is called a :dfn: `generator function `. Such a function, when
789789called, always returns an :term: `iterator ` object which can be used to
790790execute the body of the function: calling the iterator's
791791:meth: `iterator.__next__ ` method will cause the function to execute until
792- it provides a value using the :keyword: `!yield ` statement . When the
792+ it provides a value using the :keyword: `!yield ` expression . When the
793793function executes a :keyword: `return ` statement or falls off the end, a
794794:exc: `StopIteration ` exception is raised and the iterator will have
795795reached the end of the set of values to be returned.
@@ -816,7 +816,7 @@ Asynchronous generator functions
816816 single: asynchronous generator; asynchronous iterator
817817
818818A function or method which is defined using :keyword: `async def ` and
819- which uses the :keyword: `yield ` statement is called a
819+ which contains a :keyword: `yield ` expression is called a
820820:dfn: `asynchronous generator function `. Such a function, when called,
821821returns an :term: `asynchronous iterator ` object which can be used in an
822822:keyword: `async for ` statement to execute the body of the function.
0 commit comments