[Python-ideas] Deprecating rarely used str methods
Andrew Barnert
abarnert at yahoo.com
Fri Aug 9 18:12:03 CEST 2013
On Aug 8, 2013, at 11:32, Serhiy Storchaka <storchaka at gmail.com> wrote:
People have already said what I want to say on most of these, but:
> str(n).zfill(width) == '{:0={}}'.format(n, width) == '%0*.f' % (width,n)
This one comes up all the time on Stack Overflow and similar places. Even when I would use format in my own code, it's a whole lot easier to explain zfill to a novice than to explain the format mini language(s) to someone who's never used anything but bare {} (or %s).
> str.swapcase() is just not needed.
What about when I need to deliver the secret documents to my CIA contact? If we couldn't swap cases at the baggage carousel, that would affect national security, or at least the ability of Hollywood to write formulaic thrillers.
More information about the Python-ideas
mailing list