[Python-ideas] Deprecating rarely used str methods
Antoine Pitrou
solipsis at pitrou.net
Fri Aug 9 22:46:13 CEST 2013
On Fri, 09 Aug 2013 16:29:14 -0400
random832 at fastmail.us wrote:
> 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)
... which doesn't strike me as very readable either, let alone easy to
remember.
Regards
Antoine.
More information about the Python-ideas
mailing list