[Pyrex] Dynamic wrapping of external C libraries?

Jim Kleckner jek-gmane at kleckner.net
Sun Oct 28 02:36:35 CEST 2007


Greg Ewing wrote:
> Jim Kleckner wrote:
>> By the way, it occurs to me that implementing this mechanism
>> would be an express train for wrapping static libraries
>> and making the available to Python... 
> 
> Um, no, because it only makes the functions available
> to other C code, not Python. You still have to write
> Python wrappers in Pyrex to do that.

True enough, but...

 >> In fact, you could coax SWIG to provide a Pyrex back end
 >> to generate the .pxd files..

One could coax SWIG to also produce the .pyx files to wrap.

It begs the question, why not just use SWIG in that case.

The answer probably is that if all you want is just wrapping,
then use SWIG.  But if you want access to the types from Pyrex
then it may make sense.

So SWIG becomes the express train for exposing C code to Pyrex
(and possibly Python as well).




More information about the Pyrex mailing list