[pyicu-dev] Sorting with keys
Andi Vajda
vajda at osafoundation.org
Thu Apr 23 11:03:03 PDT 2009
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 ?
> Is there a way to use PyICU to do this? I notice
> there's no wrapper for Collator.getSortKey(); would that do the trick?
That looks like an oversight, especially since getCollationKey() is
deprecated.
I now added it to svn: http://svn.osafoundation.org/pyicu/trunk/collator.cpp
I only checked that the code compiled. I didn't actually try to run this.
If you send me a piece of code that illustrates what you're after that would
help.
Please try the fix out and let me know if it works.
Thanks !
Andi..
More information about the pyicu-dev
mailing list