[Zope] dtml-in sort by generic function

Oleg Broytmann Oleg Broytmann <phd@phd.fep.ru>
Thu, 29 Mar 2001 15:40:03 +0400 (MSD)


On Wed, 28 Mar 2001, Dieter Maurer wrote:
>  >    Ok. Do you see any non-cmp functions beynd these "locale" and
>  > case_insensitive? :) I can't work out a good set of predefined functions.
>  > All those string, date, numeric comparisons - they are just cmp and
>  > nothing more.
> Maybe, you already found the most essential ones.

   I think so :)

> Of course, it would be easy to add further ones, when we find
> some more interesting candidates.

   But of course :)

> BTW, are all "locale" comparison functions case insensitive?
> Unlike most other people, I like case sensitive comparisons.

   What do you mean? locale.strcoll? I beleive it IS case sensitive.

import locale
locale.setlocale(locale.LC_ALL, "")

print locale.strcoll("aB", "Ab")
print locale.strcoll("Ab", "aB")

Oleg.
----
     Oleg Broytmann     http://www.zope.org/Members/phd/     phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.