[Python-ideas] Deprecating rarely used str methods

Andrew Barnert abarnert at yahoo.com
Mon Aug 12 09:20:33 CEST 2013


On Aug 11, 2013, at 23:54, Benjamin Peterson <benjamin at python.org> wrote:

> Andrew Barnert <abarnert at ...> writes:
> 
>> 
>> On Aug 11, 2013, at 23:10, Benjamin Peterson <benjamin at ...> wrote:
>> 
>>> Andrew Barnert <abarnert <at> ...> writes:
>>> 
>>>> 
>>>> On Aug 11, 2013, at 20:32, Benjamin Peterson <benjamin <at> python.org>
> wrote:
>>>> 
>>>>> Serhiy Storchaka <storchaka <at> ...> writes:
>>>>> 
>>>>>> str.swapcase() is just not needed.
>>>>> 
>>>>> I would quite love to get rid of this method, since it's basically useless
>>>>> and wrong on non-ASCII strings.
>>>> 
>>>> No it isn't.
>>> 
>>> I realize it "handles" non-ASCII characters, but I claim there is no
>>> sensical behavior.
>> 
>> So you want Python to not follow Unicode in general, or just in case
> mapping, or just in this one function
>> (leaving upper, lower, etc. alone)?
>> 
>> Out of curiosity, what language do you use that has no sensible behavior?
> Most scripts either have sensible
>> case rules, or just don't have cases (so the function is an obvious
> no-op). I know some people think Unicode
>> chose the _wrong_ rule for their script (e.g., the Turkish i mentioned
> earlier--even if it is what most
>> Turkish computer users wanted, there are purists who insist it should work
> properly, or that Turkish
>> dotted i and dotless I should be separate characters from their Latin
> equivalents). But that's not the
>> same as saying there _are_ no good rules for their script.
> 
> In the precense of things like title case, "swapping" case isn't always an
> operation that can make sense.

As far as I know, there aren't any titlecase characters. The titlecase function 


More information about the Python-ideas mailing list