[Chandler-dev] PyICU no longer uses SWIG

Andi Vajda vajda at osafoundation.org
Tue Apr 4 16:14:07 PDT 2006


As of release 0.5, on the PyICU development trunk, SWIG is no longer used.
Instead, the Python object wrappers are implemented by hand using the Python C 
type system.

The handwritten wrappers represent about 12,000 lines of C++ code, a lot of 
boilerplate. Although macros are heavily used, the rather repetitive nature of 
this code makes it easy to make copy/paste mistakes along the way.

The few PyICU unit tests are passing but I expect typos and mistakes to still 
be lurking. If you find something wrong, it'll most likely crash or report an 
InvalidArgsError that should be trivial to fix by following the general 
argument passing patterns used with parseArg() and parseArgs(). Please report 
these bugs and/or submit patches to fix them.

I also changed all methods that return a mutable ICU UnicodeString to return 
an immutable python unicode string instead. If a mutable ICU UnicodeString 
object is actually desired, all these APIs accept an additional UnicodeString 
argument (usually in the position of the ICU API's UnicodeString& parameter) 
that will be modified in-place with the return value.

Andi..


More information about the chandler-dev mailing list