File tree 1 file changed +6
-5
lines changed
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 ``'}'``.
680
680
681
681
Expressions in formatted string literals are treated like regular
682
682
Python 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.
688
689
689
690
If a conversion is specified, the result of evaluating the expression
690
691
is converted before formatting. Conversion ``'!s' `` calls :func: `str ` on
You can’t perform that action at this time.
0 commit comments