Skip to content

Commit

Permalink
MAINT: Also remove the new unused private _PyArray_GetNumericOps
Browse files Browse the repository at this point in the history
Unlike the set version, we don't use it internally.
  • Loading branch information
seberg committed Jun 19, 2023
1 parent b6b5d97 commit 179d2d5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 59 deletions.
56 changes: 0 additions & 56 deletions numpy/core/src/multiarray/number.c
Expand Up @@ -122,62 +122,6 @@ _PyArray_SetNumericOps(PyObject *dict)
}


/* Note - macro contains goto */
#define GET(op) if (n_ops.op && \
(PyDict_SetItemString(dict, #op, n_ops.op)==-1)) \
goto fail;

NPY_NO_EXPORT PyObject *
_PyArray_GetNumericOps(void)
{
PyObject *dict;
if ((dict = PyDict_New())==NULL)
return NULL;
GET(add);
GET(subtract);
GET(multiply);
GET(divide);
GET(remainder);
GET(divmod);
GET(power);
GET(square);
GET(reciprocal);
GET(_ones_like);
GET(sqrt);
GET(negative);
GET(positive);
GET(absolute);
GET(invert);
GET(left_shift);
GET(right_shift);
GET(bitwise_and);
GET(bitwise_or);
GET(bitwise_xor);
GET(less);
GET(less_equal);
GET(equal);
GET(not_equal);
GET(greater);
GET(greater_equal);
GET(floor_divide);
GET(true_divide);
GET(logical_or);
GET(logical_and);
GET(floor);
GET(ceil);
GET(maximum);
GET(minimum);
GET(rint);
GET(conjugate);
GET(matmul);
GET(clip);
return dict;

fail:
Py_DECREF(dict);
return NULL;
}

static PyObject *
_get_keywords(int rtype, PyArrayObject *out)
{
Expand Down
3 changes: 0 additions & 3 deletions numpy/core/src/multiarray/number.h
Expand Up @@ -52,9 +52,6 @@ array_int(PyArrayObject *v);
NPY_NO_EXPORT int
_PyArray_SetNumericOps(PyObject *dict);

NPY_NO_EXPORT PyObject *
_PyArray_GetNumericOps(void);

NPY_NO_EXPORT PyObject *
PyArray_GenericBinaryFunction(PyObject *m1, PyObject *m2, PyObject *op);

Expand Down

0 comments on commit 179d2d5

Please sign in to comment.