[Pyrex] Extension types

Lenard Lindstrom len-l at telus.net
Thu Sep 22 02:04:27 CEST 2005


On 20 Sep 2005 at 22:42, Nitin Madnani wrote:

> So I am thinking about implementing all the data structures that I  
> need as extension types in Pyrex. Is this going to be equivalent to  
> writing my structures in pure C and using swig to create a pyhon  
> module? Is one better than the other? Are there any overheads?
> 

Swig is for wrapping existing C libraries with as little fuss as possible. The interfaces 
it generates can be customized if you are willing to spend the time studying the 
documentation.

Pyrex is for writing extension modules from scratch, though naturally it can also be 
used to create wrappers. But I would try writing the module in pure Python if 
possible and only make it an extension module if performation or memory is an 
issue.

Lenard Lindstrom
<len-l at telus.net>




More information about the Pyrex mailing list