summaryrefslogtreecommitdiffstats
path: root/Doc/reference
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-02-14 00:03:13 (GMT)
committerGitHub <noreply@github.com>2020-02-14 00:03:12 (GMT)
commit46cf4fc8a5646ca35f7d1ac06d2ef33eb9efca1d (patch)
tree71340e618441854fd8b0c57b1dd2d5711ccc89ac /Doc/reference
parentf464edf3239f7867fe31c9cd238a68fb3b90feaa (diff)
downloadcpython-46cf4fc8a5646ca35f7d1ac06d2ef33eb9efca1d.zip
cpython-46cf4fc8a5646ca35f7d1ac06d2ef33eb9efca1d.tar.gz
cpython-46cf4fc8a5646ca35f7d1ac06d2ef33eb9efca1d.tar.bz2
bpo-39545: Document changes in the support of await in f-strings. (GH-18456)
https://bugs.python.org/issue39545 (cherry picked from commit f632736023502816f2e6bd714d1b48c81aa2ccc1) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/lexical_analysis.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index 7b90f3b..9f51f41 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -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`.