diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-02-13 23:57:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-13 23:57:35 (GMT) |
commit | f632736023502816f2e6bd714d1b48c81aa2ccc1 (patch) | |
tree | 16b30a96c4a5353738879cf8d3680a46784a590d /Doc/reference | |
parent | 10e87e5ef4c1b4fb8415d9ddc362e2591f2f0b6c (diff) | |
download | cpython-f632736023502816f2e6bd714d1b48c81aa2ccc1.zip cpython-f632736023502816f2e6bd714d1b48c81aa2ccc1.tar.gz cpython-f632736023502816f2e6bd714d1b48c81aa2ccc1.tar.bz2 |
bpo-39545: Document changes in the support of await in f-strings. (GH-18456)
https://bugs.python.org/issue39545
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/lexical_analysis.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index c0e13b5..3d4b03e 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -685,6 +685,11 @@ 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`. |