[Numpy-tickets] [NumPy] #426: give ctypes.data_as a reference to the array
NumPy
numpy-tickets at scipy.net
Sat Jan 20 14:44:42 CST 2007
#426: give ctypes.data_as a reference to the array
-----------------------------+----------------------------------------------
Reporter: martin_wiechert | Owner: somebody
Type: enhancement | Status: closed
Priority: normal | Milestone: 1.0.2 Release
Component: numpy.core | Version: devel
Severity: normal | Resolution: wontfix
Keywords: |
-----------------------------+----------------------------------------------
Changes (by oliphant):
* status: new => closed
* resolution: => wontfix
Comment:
I think a warning in the documentation is definitely warranted. I'm not
sure we can actually avoid these kinds of problems entirely, though. It
seems to me that any facility in ctypes would be just as hard to use (and
possibly less clear), then keeping the reference yourself. Whenever you
use ctypes you can't pass pointers of temporary variables around.
There is a reference to the array kept in the ctypes structure also. So,
you could write
ct = (a+b).ctypes
And then proceed from there. But, if you get rid of the ctypes structure
then you get rid of that reference as well.
I think the only solution is programmer responsibility when passing
pointers to data-areas around.
--
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/426#comment:1>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list