Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Doc/reference/lexical_analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,8 @@ 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
format specifiers, but may not include more deeply-nested replacement fields.
:ref:`format specifiers <formatspec>`, but may not include more
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great addition, but it would also be good to explicitly state, without having to follow a link, that f-strings use the same format mini-langage as the .format() method. Maybe:

These nested fields may include their own conversion fields and format specifiers, 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.

maybe put the ref in the seconds sentence?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense :) I'll make another PR later today.

deeply-nested replacement fields.

Formatted string literals may be concatenated, but replacement fields
cannot be split across literals.
Expand Down