exposing C array to python namespace: NumPy and array module.

Bo Peng bpeng at rice.edu
Sat Jan 1 23:02:35 CET 2005


Scott David Daniels wrote:

> Python's array module is not built to do this well.  It can re-size the
> array, delete elements inside the array, and other things that don't
> work very well with C-managed data.  I wrote "blocks and views" to
> overcome this problem.  

As always the case, this problem have been encountered and solved! Your 
code is exactly what I needed. However, I was too impatient to wait for 
your reply. :-) I have realized the problems of arraymodule.c and added 
a ob_ownmem member in the object structure. Existing operations have 
been modified (mostly unchanged) according to this flag and the new 
module works well.

Thank everyone for the help. especially in thie new year's day.

Bo



More information about the Python-list mailing list