Commit f4e21a2a authored by KatherineMichel's avatar KatherineMichel Committed by Mariatta

Improve the F-strings and format specifier documentation (GH-4931)

Mention that the format-specifier mini language in f-strings
is the same one used by str.format.
parent f7686c1f
...@@ -654,10 +654,11 @@ expression or conversion result. An empty string is passed when the ...@@ -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 format specifier is omitted. The formatted result is then included in
the final value of the whole string. the final value of the whole string.
Top-level format specifiers may include nested replacement fields. Top-level format specifiers may include nested replacement fields. These nested
These nested fields may include their own conversion fields and fields may include their own conversion fields and :ref:`format specifiers
:ref:`format specifiers <formatspec>`, but may not include more <formatspec>`, but may not include more deeply-nested replacement fields. The
deeply-nested replacement fields. :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 Formatted string literals may be concatenated, but replacement fields
cannot be split across literals. cannot be split across literals.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment