Hello Pauli,
excuse me if I insist, PyArray_Conjugate is not the problem.
If when using the numpy API, it is accepted something like:
 ob1 = PyArray_CreateSomehowAnArray(....);
 obj2 = PyArray_DoSomethingWithArray(obj1,...);
 obj3 = PyArray_DoSomethingElseWithArray(obj1,...);
 Py_DECREF(obj1);
then there is no way my patch is guaranteed to not break things.

What happens with conjugate can happen with sin, round, sum, prod, ...
The problem is that the philosophy of the patch is:
"If I (function) have been called with an input with ref_count=1,
that input is mine and I can do whatever I want with it. If you (caller)
need it for later be sure you let me know by incrementing its ref_count."

>From what I understand, this works fine from within numpy, by
changing a few operations (like divmod and variance) but could
break libraries using the numpy C API.

I hope someone can find a way to have the cake and eat it too.

Best,
Luca
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to