Message261881
| Author |
py.user |
| Recipients |
docs@python, eric.smith, ezio.melotti, py.user, python-dev, terry.reedy |
| Date |
2016年03月17日.02:38:33 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1458182314.17.0.053443562129.issue15660@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
There is a funny thing in 3.6.0a0
>>> '{:<09}'.format(1)
'100000000'
>>> '{:<09}'.format(10)
'100000000'
>>> '{:<09}'.format(100)
'100000000'
>>>
Actually, it behaves like a string, but the format should call internal format function of the passed number and the internal format function should not format different numbers as equal numbers.
Why does it represent number 1 as number 10?
>>> format(1, '<02')
'10'
>>> format(10, '')
'10'
>>>
I guess, there should be a restriction.
Zero padding for numbers should be correct. |
|