diff options
Diffstat (limited to 'Doc/reference/lexical_analysis.rst')
-rw-r--r-- | Doc/reference/lexical_analysis.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index bee02443e62..3a03b947162 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -683,6 +683,15 @@ 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. +.. index:: + keyword: await + single: async for; in comprehensions + +An :keyword:`await` expression and comprehensions containing an +:keyword:`async for` clause are illegal in the expression in formatted +string literals. (The reason is a problem with the implementation --- +this restriction is lifted in Python 3.7). + 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`. |