Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -798,12 +798,12 @@ Generator functions
single: generator; function
single: generator; iterator

A function or method which uses the :keyword:`yield` statement (see section
:ref:`yield`) is called a :dfn:`generator function`. Such a function, when
A function or method which contains a :keyword:`yield` expression (see section
:ref:`yieldexpr`) is called a :dfn:`generator function`. Such a function, when
called, always returns an :term:`iterator` object which can be used to
execute the body of the function: calling the iterator's
:meth:`iterator.__next__` method will cause the function to execute until
it provides a value using the :keyword:`!yield` statement. When the
it provides a value using the :keyword:`!yield` expression. When the
function executes a :keyword:`return` statement or falls off the end, a
:exc:`StopIteration` exception is raised and the iterator will have
reached the end of the set of values to be returned.
Expand All @@ -830,7 +830,7 @@ Asynchronous generator functions
single: asynchronous generator; asynchronous iterator

A function or method which is defined using :keyword:`async def` and
which uses the :keyword:`yield` statement is called a
which contains a :keyword:`yield` expression is called a
:dfn:`asynchronous generator function`. Such a function, when called,
returns an :term:`asynchronous iterator` object which can be used in an
:keyword:`async for` statement to execute the body of the function.
Expand Down
Loading