From: Matthias Bussonnier <bussonniermatthias@gmail.com>
Date: Wed, 22 May 2019 19:07:45 +0000 (-0700)
Subject: bpo-34616: Document top level async in whatsnew/3.8. (GH-13484)
X-Git-Tag: v3.8.0b1~256
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ddbd21aec7f0e2f237a1073d3e0b313e673413f;p=python

bpo-34616: Document top level async in whatsnew/3.8. (GH-13484)



https://bugs.python.org/issue34616
---

diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index 63b8200a15..68843e2d9e 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -237,6 +237,16 @@ asyncio
 
 On Windows, the default event loop is now :class:`~asyncio.ProactorEventLoop`.
 
+builtins
+--------
+
+The :func:`compile` built-in has been improved to accept the
+``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag. With this new flag passed,
+:func:`compile` will allow top-level ``await``, ``async for`` and ``async with``
+constructs that are usually considered invalid syntax. Asynchronous code object
+marked with the ``CO_COROUTINE`` flag may then be returned.
+
+(Contributed by Matthias Bussonnier in :issue:`34616`)
 
 collections
 -----------