The form of format specifier is the following
[[fill]align][sign]["z"]["#"]["0"][width][grouping_option]["." precision][type]
Docs describe each option in the following order:
align and fill.
sign.
- Option
z.
- Option
#.
- Option
,.
- Option
_.
width, then option 0.
precision.
type.
As you can notice, options , and _ are not present in format spec, because they are actually part of grouping_option. For whatever reason they are described before width, but most importantly, their descriptions never mention they are part of grouping_option.
It can be super confusing for the first readthrough, as descriptions are out of order and written similar to standalone options z and #. I suggest the following changes:
- Place descriptions of options
, and _ after the description of width.
- Mention that they are part of
grouping_option.
- Maybe change BNF specification of
grouping_option to "," | "_" to match their description order and order of addition to Python.
Example change:
The grouping_option determines how digits in numbers are grouped. Its first option, ',', signals...
The other grouping_option, '_', signals...
Alternatively, these description can be placed in a table, similar for the list of string presentation types.
The grouping_option determines how digits in numbers are grouped. It can be one of the following:
==here goes the table==
Linked PRs
The form of format specifier is the following
Docs describe each option in the following order:
alignandfill.sign.z.#.,._.width, then option0.precision.type.As you can notice, options
,and_are not present in format spec, because they are actually part ofgrouping_option. For whatever reason they are described beforewidth, but most importantly, their descriptions never mention they are part ofgrouping_option.It can be super confusing for the first readthrough, as descriptions are out of order and written similar to standalone options
zand#. I suggest the following changes:,and_after the description of width.grouping_option.grouping_optionto"," | "_"to match their description order and order of addition to Python.Example change:
Alternatively, these description can be placed in a table, similar for the list of string presentation types.
Linked PRs