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 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);
History
Date User Action Args
2012-01-03 22:59:53vstinnersetrecipients: + vstinner, loewis, mark.dickinson, eric.smith, benjamin.peterson, ezio.melotti, skrah
2012-01-03 22:59:53vstinnersetmessageid: <1325631593.36.0.0505643403688.issue13706@psf.upfronthosting.co.za>
2012-01-03 22:59:52vstinnerlinkissue13706 messages
2012-01-03 22:59:52vstinnercreate