[Numpy-discussion] NumPtr vs NumPy.i to access C

Jose Martin maitai02@excite....
Sun May 18 07:19:37 CDT 2008

Thanks everyone for all the comments! It helped to understand better the advantages/disadvantages of the various options to interact with C. 


 --- On Sat 05/17, Bill Spotz < wfspotz@sandia.gov > wrote:

Just to make sure the original question gets answered, yes, numpy.i 
avoids copies as much as possible.

A special case is when your C code provides you with a view of its 
internal data and does not require any memory to be allocated by the 
(python) user. This can be dangerous, but if it is your use case, be 
sure to use the ARGOUTVIEW_* typemaps.

Oh, and Brian's description of SWIG is an eminently fair one.

AND, if NumPtr is only for Numeric, you should know that Numeric is no 
longer developed or supported.

Join Excite! - http://www.excite.com
The most personalized portal on the Web!

More information about the Numpy-discussion mailing list