Mark Dickinson <dicki...@gmail.com> added the comment:

> Regarding cases 3-7 I'd like to suggest a slightly different resolution:

Hmm, yes. I was concentrating on the Decimal results, but I agree that these 
int/float results are disturbing:

>>> format(12345, "<020")
'12345000000000000000'
>>> format(12345.0, "<020")
'12345.00000000000000'
>>> format(12345, "^020")
'00000001234500000000'

I'm fine with an explicit *fill* character of zero producing misleading 
results; the user just gets what they ask for in that case. (And the filling 
could be happening in generic code that isn't aware of the numeric context any 
more, so it could be tricky to change.)

But having the pre-width 0 be interpreted this way is questionable. Eric: 
thoughts?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39077>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to