@@ -196,8 +196,7 @@ they may depend on the values obtained from the leftmost iterable. For example:
196
196
197
197
To ensure the comprehension always results in a container of the appropriate
198
198
type, ``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.
201
200
202
201
Since Python 3.6, in an :keyword: `async def ` function, an :keyword: `async for `
203
202
clause may be used to iterate over a :term: `asynchronous iterator `.
@@ -214,8 +213,8 @@ See also :pep:`530`.
214
213
.. versionadded :: 3.6
215
214
Asynchronous comprehensions were introduced.
216
215
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.
219
218
220
219
221
220
.. _lists :
@@ -350,9 +349,7 @@ The parentheses can be omitted on calls with only one argument. See section
350
349
351
350
To avoid interfering with the expected operation of the generator expression
352
351
itself, ``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.
356
353
357
354
If a generator expression contains either :keyword: `async for `
358
355
clauses or :keyword: `await ` expressions it is called an
@@ -368,8 +365,8 @@ which is an asynchronous iterator (see :ref:`async-iterators`).
368
365
only appear in :keyword: `async def ` coroutines. Starting
369
366
with 3.7, any function can use asynchronous generator expressions.
370
367
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.
373
370
374
371
375
372
.. _yieldexpr :
@@ -401,12 +398,10 @@ coroutine function to be an asynchronous generator. For example::
401
398
402
399
Due to their side effects on the containing scope, ``yield `` expressions
403
400
are 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.
407
402
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
410
405
implement comprehensions and generator expressions.
411
406
412
407
Generator functions are described below, while asynchronous generator
0 commit comments