8000 [3.12] GH-95088: Clarify rules for parsing an item key for format strings (GH-103779) by miss-islington · Pull Request #105419 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.12] GH-95088: Clarify rules for parsing an item key for format strings (GH-103779) #105419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2023
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
4 changes: 3 additions & 1 deletion Doc/library/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ See also the :ref:`formatspec` section.

The *field_name* itself begins with an *arg_name* that is either a number or a
keyword. If it's a number, it refers to a positional argument, and if it's a keyword,
it refers to a named keyword argument. If the numerical arg_names in a format string
it refers to a named keyword argument. An *arg_name* is treated as a number if
a call to :meth:`str.isdecimal` on the string would return true.
If the numerical arg_names in a format string
are 0, 1, 2, ... in sequence, they can all be omitted (not just some)
and the numbers 0, 1, 2, ... will be automatically inserted in that order.
Because *arg_name* is not quote-delimited, it is not possible to specify arbitrary
Expand Down
0