This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Terry Davis
Recipients Terry Davis, domdfcoding, eric.smith, mark.dickinson, rhettinger, serhiy.storchaka, vstinner
Date 2021-03-29.20:39:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1617050389.37.0.784355727196.issue43624@roundup.psfhosted.org>
In-reply-to
Content
Victor,
> '_.f' would be the same as '_f'?
No, the example in my original post is wrong, '_.f' isn't allowed now.
The proposal should use '_f' to describe the current behavior.

> Should "._f" be allowed to only add underscores in the fractional part? (for consistency?)

Yes, but not for consistency with the above usage, instead it's so both fractional and integral underscores can be specified on their own.

Here is my attempt at updating the format spec. The only problem I have with it is that it allows a naked '.'; I don't know how to specify "dot must be followed by one or both of 'float_grouping' and 'precision'".

Current:
format_spec     ::=  [[fill]align][sign][#][0][width][grouping_option][.precision][type]

Proposed:
format_spec     ::=  [[fill]align][sign][#][0][width][grouping_option][.[float_grouping][precision]][type]
fill            ::=  <any character>
align           ::=  "<" | ">" | "=" | "^"
sign            ::=  "+" | "-" | " "
width           ::=  digit+
grouping_option ::=  "_" | ","
float_grouping  ::=  "_"
precision       ::=  digit+
type            ::=  "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
History
Date User Action Args
2021-03-29 20:39:49Terry Davissetrecipients: + Terry Davis, rhettinger, mark.dickinson, vstinner, eric.smith, serhiy.storchaka, domdfcoding
2021-03-29 20:39:49Terry Davissetmessageid: <1617050389.37.0.784355727196.issue43624@roundup.psfhosted.org>
2021-03-29 20:39:49Terry Davislinkissue43624 messages
2021-03-29 20:39:49Terry Daviscreate
Morty Proxy This is a proxified and sanitized view of the page, visit original site.