[Python-ideas] Deprecating rarely used str methods

Steven D'Aprano steve at pearwood.info
Mon Aug 12 10:07:48 CEST 2013


On Mon, Aug 12, 2013 at 12:27:51AM -0700, Andrew Barnert wrote:

> There aren't any title case characters. Title casing turns each 
> character into one or more uppercase or lowercase characters. And 
> swapcase will do exactly what you'd expect.

Actually, there are titlecase characters:

http://www.fileformat.info/info/unicode/category/Lt/list.htm
http://unicode.org/faq/casemap_charprop.html


I think it is reasonable to remove str.swapcase from Python 4000, if and 
when it exists, provided it is allowed to break backwards compatibility 
(which is *not* a given). When there is a planned schedule for Python 
4000, then it is time to talk about deprecating str.swapcase. Until 
then, it's a wart that exists for backwards compatibility, but the pain 
in removing it far outweighs the pain in merely ignoring it.

We the Python community are halfway through a ten-year, painful, 
backwards-incompatible migration from 2.x to 3.x. To justify further 
backwards-incompatible changes in the 3.x series will require a much 
stronger rationale than just "I don't know anyone who uses this method".


-- 
Steven


More information about the Python-ideas mailing list