File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -680,11 +680,12 @@ with a closing curly bracket ``'}'``.
680680
681681Expressions in formatted string literals are treated like regular
682682Python expressions surrounded by parentheses, with a few exceptions.
683- An empty expression is not allowed, and a :keyword: `lambda ` expression
684- must be surrounded by explicit parentheses. Replacement expressions
685- can contain line breaks (e.g. in triple-quoted strings), but they
686- cannot contain comments. Each expression is evaluated in the context
687- where the formatted string literal appears, in order from left to right.
683+ An empty expression is not allowed, and both :keyword: `lambda ` and
684+ assignment expressions ``:= `` must be surrounded by explicit parentheses.
685+ Replacement expressions can contain line breaks (e.g. in triple-quoted
686+ strings), but they cannot contain comments. Each expression is evaluated
687+ in the context where the formatted string literal appears, in order from
688+ left to right.
688689
689690If a conversion is specified, the result of evaluating the expression
690691is converted before formatting. Conversion ``'!s' `` calls :func: `str ` on
You can’t perform that action at this time.
0 commit comments