[Numpy-discussion] Change array memory ownership status

Marc POINOT Marc.Poinot@onera...
Wed Sep 5 04:05:00 CDT 2007

I want to change the "status" of a numpy array.
I mean this array was created by a server application using PyArray_FromDimsAndData that sets the NPY_OWNDATA flag to False.

The server application believes the client would free the memory.
But there are more than one client application and none knows who is in charge of freeing this memory.
Then I want to set the flag NPY_OWNDATA to True to tell the server to do the job when it finishes the script.

How can I do that, I mean at the Python interface level, not the C API.

>>> print a.flags.owndata
>>> a.flags.owndata=False
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: attribute 'owndata' of 'numpy.flagsobj' objects is not writable

Or should I have to write my own function set/get for OWNDATA ?
The get is there but I can't get the set...

  Marc POINOT [ONERA/DSNA] Tel:+  Fax:+

  Avertissement/disclaimer http://www.onera.fr/onera-en/emails-terms

More information about the Numpy-discussion mailing list