[Python-Dev] Re: other "magic strings" issues

Alex Martelli aleaxit at yahoo.com
Wed Nov 12 08:12:35 EST 2003


On Wednesday 12 November 2003 01:41 pm, Michael Hudson wrote:
> David Eppstein <eppstein at ics.uci.edu> writes:
> > Ok, it sounds like I am stuck with PyObjC's
> > NSString.localizedCaseInsensitiveCompare_, since Python's built-in
> > cmp(unicode,unicode) sucks and locale doesn't provide an alternative.
>
> "sucks" is too strong.  Maybe there should be better collation support
> but I don't think we should change the default comparison to do it.

That seems sensible to me.  However, if we do get stuck with a
"comparison function", then sorting may not be quite as smooth (the
cf would need to be called for each comparison); it might be better
to be able to get something suitable for passing to key=  -- i.e., the
equivalent of C's strxfrm(), rather than of strcoll(), if one had to choose.


Alex




More information about the Python-Dev mailing list