Skip to content

Commit 2ddbd21

Browse files
Carreaumiss-islington
authored andcommitted
bpo-34616: Document top level async in whatsnew/3.8. (GH-13484)
https://bugs.python.org/issue34616
1 parent b121f63 commit 2ddbd21

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Doc/whatsnew/3.8.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,16 @@ asyncio
237237

238238
On Windows, the default event loop is now :class:`~asyncio.ProactorEventLoop`.
239239

240+
builtins
241+
--------
242+
243+
The :func:`compile` built-in has been improved to accept the
244+
``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag. With this new flag passed,
245+
:func:`compile` will allow top-level ``await``, ``async for`` and ``async with``
246+
constructs that are usually considered invalid syntax. Asynchronous code object
247+
marked with the ``CO_COROUTINE`` flag may then be returned.
248+
249+
(Contributed by Matthias Bussonnier in :issue:`34616`)
240250

241251
collections
242252
-----------

0 commit comments

Comments
 (0)