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

Charles R Harris charlesr.harris at gmail.com
Fri Jan 24 19:56:43 EST 2020


On Fri, Jan 24, 2020 at 11:29 AM Sebastian Berg <sebastian at sipsolutions.net>
wrote:

> 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.
>
>
I don't think C-API functions should be removed. Deprecation is fine, but
removal changes the customary order of the functions. If they cost nothing
to maintain, just leave them alone with a note/documentation that there are
preferable alternatives.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20200124/1eee6359/attachment.html>


More information about the NumPy-Discussion mailing list