[Zope-dev] case insensitive sorts

Chris Withers chrisw@nipltd.com
Wed, 06 Dec 2000 18:00:31 +0000


Andy McKay wrote:
> 
> Anyway Ive patched dtml-in and dtml-tree to do this sort on a ignore_case
> tag. Is this useful to anyone else?

yes! :-)

> And Ive thought of patching my Zope so
> this is the default behaviour.... what does anyone else think. The next
> thing to patch is ZCatalog...

To be honest, why not just mail Guido (not literally! ;-) and suggest a
change to python. IMNSHO, the default sort isn't as useful as it could
be because of this and should be made to behave as you describe rather
than like it is now. Pretty much every sort I do of strings in a python
project uses the sort method below insetad of the default. This is a
pain.

def _default_sort(x,y):
    return cmp(string.lower(x),string.lower(y))

Who thinks the default python sort should stay like it is? Who thinks it
should change? 
(reasons of course would be helpful, particularly if you want it to stay
like it is ;-)

cheers,

Chris

PS: With this being a general python issue, IMO, I've cc'ed to the
python list, hope I'm not out of order...

PPS: Is there such a thing as wishlist@python.org, if you see what I
mean?