From 444b48b2c825552b28ac060c7368facb6f88a608 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sat, 27 Feb 2021 10:55:18 -0500 Subject: [PATCH 1/2] bpo-24650: Use full term "generator function" in yield expressions docs --- Doc/reference/expressions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 17705b117c372b..b31bb887f3964a 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -422,7 +422,7 @@ Yield expressions The yield expression is used when defining a :term:`generator` function or an :term:`asynchronous generator` function and thus can only be used in the body of a function definition. Using a yield -expression in a function's body causes that function to be a generator, +expression in a function's body causes that function to be a generator function, and using it in an :keyword:`async def` function's body causes that coroutine function to be an asynchronous generator. For example:: From bcf56ed655111808cabc6615ad48da9f36df4c5a Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Fri, 7 Jan 2022 08:21:41 -0500 Subject: [PATCH 2/2] Update additional instance of "generator" Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> --- Doc/reference/expressions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index b31bb887f3964a..8b7a84afe92c1d 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -424,7 +424,7 @@ or an :term:`asynchronous generator` function and thus can only be used in the body of a function definition. Using a yield expression in a function's body causes that function to be a generator function, and using it in an :keyword:`async def` function's body causes that -coroutine function to be an asynchronous generator. For example:: +coroutine function to be an asynchronous generator function. For example:: def gen(): # defines a generator function yield 123