swig snipe (was Re: [pyicu-dev] getCollationKey)

Jim Fulton jim at zope.com
Wed Nov 30 10:01:56 PST 2005

Andi Vajda wrote:
>> It's great to see a Python binding for ICU underway!
> Thanks, it's definitely work in progress.
>> Is the getCollationKey method of collators usable?  If so, how
>> is it called?
> You found a bug. I fixed in rev 47. Here is how you'd use it:
>>>> from PyICU import *
>>>> c=Collator.createInstance()
>>>> ck=CollationKey()
>>>> ck1=CollationKey()
>>>> c.getCollationKey('a string', ck)

This is a swig-onic api.  A Pythonic api would, of course be:

 >>> ck = c.getCollationKey('a string')

which is much better IMO.


Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org

More information about the pyicu-dev mailing list