Improve the F-strings and format specifier documentation (GH-4931) (GH-4933)
Mention that the format-specifier mini language in f-strings
is the same one used by str.format.
(cherry picked from commit f4e21a2a72
)
This commit is contained in:
parent
dc5770b161
commit
75d1ca26b0
|
@ -654,10 +654,11 @@ expression or conversion result. An empty string is passed when the
|
|||
format specifier is omitted. The formatted result is then included in
|
||||
the final value of the whole string.
|
||||
|
||||
Top-level format specifiers may include nested replacement fields.
|
||||
These nested fields may include their own conversion fields and
|
||||
:ref:`format specifiers <formatspec>`, but may not include more
|
||||
deeply-nested replacement fields.
|
||||
Top-level format specifiers may include nested replacement fields. These nested
|
||||
fields may include their own conversion fields and :ref:`format specifiers
|
||||
<formatspec>`, but may not include more deeply-nested replacement fields. The
|
||||
:ref:`format specifier mini-language <formatspec>` is the same as that used by
|
||||
the string .format() method.
|
||||
|
||||
Formatted string literals may be concatenated, but replacement fields
|
||||
cannot be split across literals.
|
||||
|
|
Loading…
Reference in New Issue