case-insensitive and internationalized sort

Bengt Richter bokr at oz.net
Thu Dec 19 20:24:27 EST 2002


On Thu, 19 Dec 2002 22:26:08 +0100, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <martin at v.loewis.de> wrote:
[...]
>> Now the next point is that it would be nice to be able to get a
>> case-insensitive sort, which seems to be the most likely thing you want to
>> do when sorting strings. If an optional casesensitive arg was added to
>> sort() then without breaking any old code you could do:
>>
>> s.sort(casesensitive=False)
>
>This won't fly. What if you are not sorting a list of strings, but, say,
>a list of numbers?

[OT] I don't see a reason to dismiss such options out of hand. If there is a **kwargs
dict, the various type-dependent cases can ignore keywords that are not relevant to them,
pretty much without cost, I would think.

I'm just making a general point, I am not even considering the topic ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list