Message237729
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.) |
|
Date |
User |
Action |
Args |
2015-03-10 05:53:55 | veky | set | recipients:
+ veky |
2015-03-10 05:53:55 | veky | set | messageid: <1425966835.2.0.36838695627.issue23624@psf.upfronthosting.co.za> |
2015-03-10 05:53:55 | veky | link | issue23624 messages |
2015-03-10 05:53:54 | veky | create | |
|