diff options
| author | Sebastian Berg <sebastian@sipsolutions.net> | 2022-03-12 17:56:31 -0800 |
|---|---|---|
| committer | Sebastian Berg <sebastian@sipsolutions.net> | 2022-04-24 21:47:50 +0200 |
| commit | efc28f7a193adae9630135aa36c84a0bddcd17fe (patch) | |
| tree | e3df15eddd29c59956c3806f6505c2245b0a3bac /numpy | |
| parent | 4fdcee8dd9f6221ff9b1df3b0187f1898315b582 (diff) | |
| download | numpy-efc28f7a193adae9630135aa36c84a0bddcd17fe.tar.gz | |
DEP: Deprecate `PyArray_ScalarFromObject`
The function was only used for the scalarmath and is not even
documented, so schedule it for deprecation.
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/src/multiarray/scalarapi.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/scalarapi.c b/numpy/core/src/multiarray/scalarapi.c index 8ed91d26c..40f1da2c4 100644 --- a/numpy/core/src/multiarray/scalarapi.c +++ b/numpy/core/src/multiarray/scalarapi.c @@ -312,6 +312,14 @@ PyArray_FromScalar(PyObject *scalar, PyArray_Descr *outcode) NPY_NO_EXPORT PyObject * PyArray_ScalarFromObject(PyObject *object) { + if (DEPRECATE( + "PyArray_ScalarFromObject() is deprecated and scheduled for " + "removal. If you are using this (undocumented) function, " + "please notify the NumPy developers to look for solutions." + "(Deprecated in NumPy 1.23)") < 0) { + return NULL; + } + PyObject *ret = NULL; if (PyArray_IsZeroDim(object)) { |
