]> granicus.if.org Git - python/commitdiff
bpo-34616: Document top level async in whatsnew/3.8. (GH-13484)
authorMatthias Bussonnier <bussonniermatthias@gmail.com>
Wed, 22 May 2019 19:07:45 +0000 (12:07 -0700)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 22 May 2019 19:07:45 +0000 (12:07 -0700)
https://bugs.python.org/issue34616

Doc/whatsnew/3.8.rst

index 63b8200a1528f02000eaec5ecdcc3f915ac986f5..68843e2d9ed1578347c641d288fb1e3e2b953c40 100644 (file)
@@ -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
 -----------