]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39545: Document changes in the support of await in f-strings. (GH-18456)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 14 Feb 2020 00:03:13 +0000 (16:03 -0800)
committerGitHub <noreply@github.com>
Fri, 14 Feb 2020 00:03:12 +0000 (16:03 -0800)
https://bugs.python.org/issue39545
(cherry picked from commit f632736023502816f2e6bd714d1b48c81aa2ccc1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Doc/reference/lexical_analysis.rst
Doc/whatsnew/3.7.rst

index 7b90f3b31c37b4108dac0a92e037e5a4bebc499a..9f51f41edd50141494ebbded9e88936cb1c4105b 100644 (file)
@@ -683,6 +683,11 @@ can contain line breaks (e.g. in triple-quoted strings), but they
 cannot contain comments.  Each expression is evaluated in the context
 where the formatted string literal appears, in order from left to right.
 
+.. versionchanged:: 3.7
+   Prior to Python 3.7, an :keyword:`await` expression and comprehensions
+   containing an :keyword:`async for` clause were illegal in the expressions
+   in formatted string literals due to a problem with the implementation.
+
 If a conversion is specified, the result of evaluating the expression
 is converted before formatting.  Conversion ``'!s'`` calls :func:`str` on
 the result, ``'!r'`` calls :func:`repr`, and ``'!a'`` calls :func:`ascii`.
index c7e3230db29e6d5c126365a2a68ffa9db7ac56f8..9644a4f31a9572d7430d4765a1b179a981e03b78 100644 (file)
@@ -493,6 +493,11 @@ of this mode.
 Other Language Changes
 ======================
 
+* An :keyword:`await` expression and comprehensions containing an
+  :keyword:`async for` clause were illegal in the expressions in
+  :ref:`formatted string literals <f-strings>` due to a problem with the
+  implementation.  In Python 3.7 this restriction was lifted.
+
 * More than 255 arguments can now be passed to a function, and a function can
   now have more than 255 parameters. (Contributed by Serhiy Storchaka in
   :issue:`12844` and :issue:`18896`.)