File tree Expand file tree Collapse file tree 2 files changed +2
-16
lines changed Expand file tree Collapse file tree 2 files changed +2
-16
lines changed Original file line number Diff line number Diff line change 65
65
#include "mapping.h"
66
66
#include "npy_static_data.h"
67
67
#include "multiarraymodule.h"
68
+ #include "../multiarray/number.h"
68
69
69
70
/********** PRINTF DEBUG TRACING **************/
70
71
#define NPY_UF_DBG_TRACING 0
@@ -90,8 +91,6 @@ typedef struct {
90
91
91
92
92
93
/* ---------------------------------------------------------------- */
93
- extern PyUFuncObject * UFUNC_MAXIMUM ;
94
- extern PyUFuncObject * UFUNC_MINIMUM ;
95
94
96
95
static PyObject *
97
96
prepare_input_arguments_for_outer (PyObject * args , PyUFuncObject * ufunc );
@@ -4373,7 +4372,7 @@ ufunc_generic_fastcall(PyUFuncObject *ufunc,
4373
4372
4374
4373
/* Extra positional args but no keywords */
4375
4374
/* DEPRECATED NumPy 2.4, 2025-08 */
4376
- if (ufunc == UFUNC_MAXIMUM || ufunc == UFUNC_MINIMUM ) {
4375
+ if (( PyObject * ) ufunc == n_ops . maximum || ( PyObject * ) ufunc == n_ops . minimum ) {
4377
4376
4378
4377
if (DEPRECATE (
4379
4378
"Passing more than 2 positional arguments to np.maximum and np.minimum "
Original file line number Diff line number Diff line change 40
40
41
41
42
42
static PyUFuncGenericFunction pyfunc_functions [] = {PyUFunc_On_Om };
43
- PyUFuncObject * UFUNC_MAXIMUM = NULL ;
44
- PyUFuncObject * UFUNC_MINIMUM = NULL ;
45
43
46
44
static int
47
45
object_ufunc_type_resolver (PyUFuncObject * ufunc ,
@@ -284,17 +282,6 @@ int initumath(PyObject *m)
284
282
PyDict_SetItemString (d , "conj" , s );
285
283
PyDict_SetItemString (d , "mod" , s2 );
286
284
287
- PyObject * tmp ;
288
- if (PyDict_GetItemStringRef (d , "maximum" , & tmp ) < 0 ) {
289
- return -1 ;
290
- }
291
- UFUNC_MAXIMUM = (PyUFuncObject * )tmp ;
292
-
293
- if (PyDict_GetItemStringRef (d , "minimum" , & tmp ) < 0 ) {
294
- return -1 ;
295
- }
296
- UFUNC_MINIMUM = (PyUFuncObject * )tmp ;
297
-
298
285
/*
299
286
* Set up promoters for logical functions
300
287
* TODO: This should probably be done at a better place, or even in the
You can’t perform that action at this time.
0 commit comments