STINNER Victor <[email protected]> added the comment:
> 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);
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue13706>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com