[Numpy-discussion] Deprecate unused but exposed C-API functions

Sebastian Berg sebastian at sipsolutions.net
Fri Jan 24 13:28:54 EST 2020

Hi all,

I would like to deprecate three C-API functions (more may come later)
in https://github.com/numpy/numpy/pull/15427

The functions are:
  * PyArray_GetArrayParamsFromObject
  * PyUfunc_GenericCall
  * PyUFunc_SetUsesArraysAsData

I could not find downstream usage for any of these and they seem useful
only on first glance to me.

The first one is too complex (regarding scalars), simply converting to
an array first should be just as well.
The second one is almost identical to `PyObject_Call`. And the third
one is not even documented and while the idea is sound, I am not sure
that there are any cases where it is useful [0]

My idea is to add the deprecation warning now, and if nobody notices it
remove them as soon as 1.19 is released.

- Sebastian

[0] It seems useful for user datatypes/loop, but using it for those
does not seem possible (or at least straight forward), since they are
usually stored in a way not accessible through this function.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20200124/99706429/attachment.sig>

More information about the NumPy-Discussion mailing list