@@ -196,8 +196,7 @@ they may depend on the values obtained from the leftmost iterable. For example:
196196
197197To ensure the comprehension always results in a container of the appropriate
198198type, ``yield `` and ``yield from `` expressions are prohibited in the implicitly
199- nested scope (in Python 3.7, such expressions emit :exc: `DeprecationWarning `
200- when compiled, in Python 3.8+ they will emit :exc: `SyntaxError `).
199+ nested scope.
201200
202201Since Python 3.6, in an :keyword: `async def ` function, an :keyword: `async for `
203202clause may be used to iterate over a :term: `asynchronous iterator `.
@@ -214,8 +213,8 @@ See also :pep:`530`.
214213.. versionadded :: 3.6
215214 Asynchronous comprehensions were introduced.
216215
217- .. deprecated :: 3.7
218- ``yield `` and ``yield from `` deprecated in the implicitly nested scope.
216+ .. versionchanged :: 3.8
217+ ``yield `` and ``yield from `` prohibited in the implicitly nested scope.
219218
220219
221220.. _lists :
@@ -350,9 +349,7 @@ The parentheses can be omitted on calls with only one argument. See section
350349
351350To avoid interfering with the expected operation of the generator expression
352351itself, ``yield `` and ``yield from `` expressions are prohibited in the
353- implicitly defined generator (in Python 3.7, such expressions emit
354- :exc: `DeprecationWarning ` when compiled, in Python 3.8+ they will emit
355- :exc: `SyntaxError `).
352+ implicitly defined generator.
356353
357354If a generator expression contains either :keyword: `async for `
358355clauses or :keyword: `await ` expressions it is called an
@@ -368,8 +365,8 @@ which is an asynchronous iterator (see :ref:`async-iterators`).
368365 only appear in :keyword: `async def ` coroutines. Starting
369366 with 3.7, any function can use asynchronous generator expressions.
370367
371- .. deprecated :: 3.7
372- ``yield `` and ``yield from `` deprecated in the implicitly nested scope.
368+ .. versionchanged :: 3.8
369+ ``yield `` and ``yield from `` prohibited in the implicitly nested scope.
373370
374371
375372.. _yieldexpr :
@@ -401,12 +398,10 @@ coroutine function to be an asynchronous generator. For example::
401398
402399Due to their side effects on the containing scope, ``yield `` expressions
403400are not permitted as part of the implicitly defined scopes used to
404- implement comprehensions and generator expressions (in Python 3.7, such
405- expressions emit :exc: `DeprecationWarning ` when compiled, in Python 3.8+
406- they will emit :exc: `SyntaxError `)..
401+ implement comprehensions and generator expressions.
407402
408- .. deprecated :: 3.7
409- Yield expressions deprecated in the implicitly nested scopes used to
403+ .. versionchanged :: 3.8
404+ Yield expressions prohibited in the implicitly nested scopes used to
410405 implement comprehensions and generator expressions.
411406
412407Generator functions are described below, while asynchronous generator
0 commit comments