[issue23624] str.center inconsistent with format "^"
Vedran Čačić
report at bugs.python.org
Tue Mar 10 09:16:26 CET 2015
Vedran Čačić added the comment:
If I see right, it seems that that (putting odd pad character on the right) is exactly what format does (I don't have Py2 here to check how exactly it behaves). So, the current proposition to change the .center to match format stays.
(I think I can see how the implementor of .center reasoned: same as people who invented banker's rounding, they wanted to "balance out" odd padding chars among the lines, so that the ammortized number of them on the left and right is the same. But I think consistency matters more here. Noone is summing the spaces on both sides and balancing these numbers, center is primarily for visual purposes, not arithmetical.)
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23624>
_______________________________________
More information about the Python-bugs-list
mailing list