[Python-ideas] Deprecating rarely used str methods

random832 at fastmail.us random832 at fastmail.us
Fri Aug 9 22:29:14 CEST 2013


On Fri, Aug 9, 2013, at 4:10, Antoine Pitrou wrote:
> -1 for deprecating those 3, they are much more readable than the format
> equivalent (seriously, those smiley-like format specs are horrible...).

99% of the time you're not going to use them in the real world.

Yes, the format string in this:
s.rjust(width, fillchar) == '{:{}>{}}'.format(s, fillchar, width)
is unpleasant, but you should think of it more as this:
s.rjust(42,'x') == '{:x>42}'.format(s)

since 90% of the time width is constant, 99% for fillchar.


More information about the Python-ideas mailing list