On Tuesday 30 September 2008 18:54:21 Travis E. Oliphant wrote:
> I just went to the code and noticed that PyArray_Resize returns None.
> So, you certainly don't want to point array to it. The array does not
> get any reference count changes.
Thanks for the very clear explanation.
> PyObject *
Ravi wrote:
> On Tuesday 30 September 2008 16:26:08 Travis E. Oliphant wrote:
>
>> You need to do something like:
>>
>> temp = PyArray_Resize(array,...)
>> Py_DECREF(array)
>> array = temp
>>
>
> In this case, since a new array may be returned, is there no way to
> synchronize with other o
On Tuesday 30 September 2008 16:26:08 Travis E. Oliphant wrote:
> You need to do something like:
>
> temp = PyArray_Resize(array,...)
> Py_DECREF(array)
> array = temp
In this case, since a new array may be returned, is there no way to
synchronize with other objects holding a reference to the ori
Ravi wrote:
> Hi,
> Consider the following code:
>
>PyArrayObject *array = get_me_an_array_along_with_a_reference(); /* 1 */
>PyArray_Dims *dims = get_me_some_dims(); /* 2 */
>array = (PyArrayObject *)PyArray_Resize( array, dims, 1 ); /* 3 */
>
> Is the code above valid?
No.
You nee
Hi,
Consider the following code:
PyArrayObject *array = get_me_an_array_along_with_a_reference(); /* 1 */
PyArray_Dims *dims = get_me_some_dims(); /* 2 */
array = (PyArrayObject *)PyArray_Resize( array, dims, 1 ); /* 3 */
Is the code above valid? In particular, is the assigment on line