Message358587
I'm not sure what you mean by the "pre-width 0". Is that the "0" here:
format_spec ::= [[fill]align][sign][#][0][width][grouping_option][.precision][type]
?
And now that I write out the question, I'm sure that's what you mean.
PEP 3101 says "If the width field is preceded by a zero ('0') character, this enables zero-padding. This is equivalent to an alignment type of '=' and a fill character of '0'.". I don't see any other discussion of it in the PEP. In particular, what if you specify a different alignment type with the pre-width 0?
I believe this all originated in C's printf, via PEP 3101. Has anyone checked what C does?
But in any event, I don't think we can change the int formatting, in particular. There's no doubt someone who's relying on every little quirk. I'm less concerned about float and decimal, although we'd still need to be very careful. |
|
Date |
User |
Action |
Args |
2019-12-17 21:45:28 | eric.smith | set | recipients:
+ eric.smith, rhettinger, facundobatista, mark.dickinson, mamrhein, skrah |
2019-12-17 21:45:28 | eric.smith | set | messageid: <1576619128.26.0.595732005929.issue39077@roundup.psfhosted.org> |
2019-12-17 21:45:28 | eric.smith | link | issue39077 messages |
2019-12-17 21:45:28 | eric.smith | create | |
|