[pyicu-dev] Sorting with keys
Michael Gardner
gardnermj at gmail.com
Fri Apr 24 02:54:22 PDT 2009
Thanks for the quick response, Andi.
Andi Vajda wrote:
>
> On Thu, 23 Apr 2009, Michael Gardner wrote:
>
>> I'd like to use PyICU to generate keys for sorting lists. I tried doing
>> something like foo.sort(key=collator.getCollationKey), but I got a
>> NotImplementedError.
>
> Can you post a piece of code that reproduces the problem ?
>
Nothing too fancy:
>>> from PyICU import *
>>> c = Collator.createInstance()
>>> l = ["a", "b", "A", "B"]
>>> l.sort(key=c.getCollationKey)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NotImplementedError
More information about the pyicu-dev
mailing list