Skip to content
Closed
Changes from 1 commit
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
Next Next commit
gh-130662: refine width/precision specification in format-spec
  • Loading branch information
skirpichev committed Mar 1, 2025
commit 3bb31f58036897612ccb464612da4aa68d42e05a
5 changes: 3 additions & 2 deletions Doc/library/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,10 @@ The general form of a *standard format specifier* is:
width_and_precision: [`width_with_grouping`][`precision_with_grouping`]
width_with_grouping: [`width`][`grouping_option`]
precision_with_grouping: "." [`precision`]`grouping_option`
width: `~python-grammar:digit`+
grouping_option: "_" | ","
precision: `~python-grammar:digit`+
width: `digits`
precision: `digits`
digits: `~python-grammar:nonzerodigit` `~python-grammar:digit`*
type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g"
: | "G" | "n" | "o" | "s" | "x" | "X" | "%"

Expand Down