Message150553
| Author |
vstinner |
| Recipients |
benjamin.peterson, eric.smith, ezio.melotti, loewis, mark.dickinson, skrah, vstinner |
| Date |
2012年01月03日.22:59:52 |
| SpamBayes Score |
3.8209564e-05 |
| Marked as misclassified |
No |
| Message-id |
<1325631593.36.0.0505643403688.issue13706@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> I assume this is left over from the PEP 393 changes.
Correct.
> I'm not sure such a restriction needs to exist any more.
The restriction was introduced to simplify the implementation. maxchar has to be computed exactly in format_string_internal(), format_int_or_long_internal(), format_float_internal() and format_complex_internal().
For format_string_internal(), the following change is enough (untested):
if (lpad != 0 || rpad != 0)
maxchar = Py_MAX(maxchar, format->fill_char);
For number formatting functions, spec->n_lpadding, spec->n_spadding and spec->n_rpadding have to be checked. Something like:
if (spec->n_lpadding || spec->n_spadding || spec->n_rpadding)
maxchar = Py_MAX(maxchar, format->fill_char); |
|