Chris Withers <[EMAIL PROTECTED]> wrote:
> Andy McKay wrote:
> > 
> > They want information fast and most users expect case insensitive sorts. Its
> > simpler and easy. I think having the ignore_case option for a -tree and -in
> > helps Zope by increasing the ease of development and friendliness to the
> > user.
> And my point was that this is so universally true that the _pthyon_ sort
> function (which is at fault here) should be fixed :-)

Python's sort already allows you to pass an alternate comparison

 [/var/home/tres] $ python
 Python 1.5.2 (#1, Feb  1 2000, 16:32:16)  [GCC egcs-2.91.66
19990314/Linux (egcs- on linux-i386
 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
 >>> foo = [ 'z', 'y', 'x' ]
 >>> foo.sort()
 >>> foo
 ['x', 'y', 'z']
 >>> foo.sort( lambda x, y: cmp(y,x) )
 >>> foo
 ['z', 'y', 'x']

I believe Andy's patch makes use of this feature.  You are missing
a couple of points if you *require* a case-insensitive sort:

 * collation (which letters belong together) is highly locale
   sensitive (e.g., does a-accent-grave sort with a? etc.)

 * Should strings which differ only in case be equal (*NOT*!)

Tres Seaver                                [EMAIL PROTECTED]
Digital Creations     "Zope Dealers"

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to