@@ -798,12 +798,12 @@ Generator functions
798798 single: generator; function
799799 single: generator; iterator
800800
801- A function or method which uses the :keyword: `yield ` statement (see section
802- :ref: `yield `) is called a :dfn: `generator function `. Such a function, when
801+ A function or method which contains a :keyword: `yield ` expression (see section
802+ :ref: `yieldexpr `) is called a :dfn: `generator function `. Such a function, when
803803called, always returns an :term: `iterator ` object which can be used to
804804execute the body of the function: calling the iterator's
805805:meth: `iterator.__next__ ` method will cause the function to execute until
806- it provides a value using the :keyword: `!yield ` statement . When the
806+ it provides a value using the :keyword: `!yield ` expression . When the
807807function executes a :keyword: `return ` statement or falls off the end, a
808808:exc: `StopIteration ` exception is raised and the iterator will have
809809reached the end of the set of values to be returned.
@@ -830,7 +830,7 @@ Asynchronous generator functions
830830 single: asynchronous generator; asynchronous iterator
831831
832832A function or method which is defined using :keyword: `async def ` and
833- which uses the :keyword: `yield ` statement is called a
833+ which contains a :keyword: `yield ` expression is called a
834834:dfn: `asynchronous generator function `. Such a function, when called,
835835returns an :term: `asynchronous iterator ` object which can be used in an
836836:keyword: `async for ` statement to execute the body of the function.
0 commit comments