[Python-Dev] Maintenance burden of str.swapcase

Glyph Lefkowitz glyph at twistedmatrix.com
Wed Sep 7 19:51:50 CEST 2011


On Sep 7, 2011, at 10:26 AM, Stephen J. Turnbull wrote:

> How about "title"?

>>> 'content-length'.title()
'Content-Length'

You might say that the protocol "has" to be case-insensitive so this is a silly frill: there are definitely enough case-sensitive crappy bits of network middleware out there that this function is critically important for an HTTP server.

In general I'd like to defend keeping as many of these methods as possible for compatibility (porting to Py3 is already hard enough).  Although even I might have a hard time defending 'swapcase', which is never used _at all_ within Twisted, on text or bytes.  The only use-case I can think of for that method is goofy joke text filters, and it wouldn't be very good at that either.

-glyph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20110907/cb602ee4/attachment.html>


More information about the Python-Dev mailing list