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 veky
Recipients veky
Date 2015-03-10.05:53:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1425966835.2.0.36838695627.issue23624@psf.upfronthosting.co.za>
In-reply-to
Content
Look at this:

    >>> format("ab", "^3"), "ab".center(3)
    ('ab ', ' ab')
    >>> format("abc", "^4"), "abc".center(4)
    ('abc ', 'abc ')

I'm sure you agree this is inconsistent. As far as I can see, format relies on // (flooring) behaviour when dividing remaining space by 2, while .center relies on round (ROUND_HALF_EVEN) behaviour. One of them should be changed to match the other.

As far as I can see, documentation (in neither case) says nothing about how _exactly_ strings are centered when there is an odd number of fill characters, so I would interpret this as: we can change either. (My preference is for .center to be changed, but this is not so important. Consistency is important.)
History
Date User Action Args
2015-03-10 05:53:55vekysetrecipients: + veky
2015-03-10 05:53:55vekysetmessageid: <1425966835.2.0.36838695627.issue23624@psf.upfronthosting.co.za>
2015-03-10 05:53:55vekylinkissue23624 messages
2015-03-10 05:53:54vekycreate