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 ncoghlan
Recipients eric.smith, ncoghlan
Date 2009-10-08.11:37:45
SpamBayes Score 6.5772504e-08
Marked as misclassified No
Message-id <1255001868.04.0.9715466253.issue7081@psf.upfronthosting.co.za>
In-reply-to
Content
The ">" alignment flag to format() is not right aligning numbers
properly on trunk and the py3k branch:

>>> format(0x1234, "+#08x")
'+0x01234'
>>> format(0x1234, "0=+#8x")
'+0x01234'
>>> format(0x1234, "0>+#8x")
'+0x01234'

That last one should be:
>>> format(0x1234, "0>+#8x")
'0+0x1234'

The intended behaviour of ">" is more obviously correct when you
consider a leading space instead of a leading zero:

>>> format(0x1234, " >+#8x")
' +0x1234'

This is only an error on the development versions - the behaviour is
correct on the 2.6 and 3.1 maintenance branches.
History
Date User Action Args
2009-10-08 11:37:48ncoghlansetrecipients: + ncoghlan, eric.smith
2009-10-08 11:37:48ncoghlansetmessageid: <1255001868.04.0.9715466253.issue7081@psf.upfronthosting.co.za>
2009-10-08 11:37:46ncoghlanlinkissue7081 messages
2009-10-08 11:37:45ncoghlancreate