Repository: numpy/numpy
File: numpy/_core/src/umath/ufunc_object.c (C)

Code before:
        for (int i = nin; i < nop; i++) {
            PyObject *tmp;
            if (i < (int)len_args) {
                tmp = args[i];
                if (tmp == Py_Ellipsis) {
                    PyErr_SetString(PyExc_TypeError,
                        "out=... is only allowed as a keyword argument.");
                    goto fail;
                }
                if (tmp != Py_None) {
                    all_none = NPY_FALSE;
                }
            }
            else {
                tmp = Py_None;
            }
            Py_INCREF(tmp);
            PyTuple_SET_ITEM(full_args.out, i-nin, tmp);
        }

        /* Extra positional args but *no* keywords */
        /* DEPRECATED NumPy 2.4, 2025-08 */
        if (strcmp(ufunc->name, "maximum") == 0 || strcmp(ufunc->name, "minimum") == 0) {
            const char *which = ufunc->name; // "maximum" or "minimum"
            char msg[256];
            snprintf(msg, sizeof(msg),
                "Passing more than 2 positional arguments to np.%s "
                "is deprecated; use out=keyword or np.%s.reduce.",
                which, which);
            
            if (DEPRECATE(msg) < 0 && PyErr_Occurred()) {
                return NULL;
            }
        }
        
        if (all_none) {
            Py_SETREF(full_args.out, NULL);
        }
    }
    else {
        full_args.out = NULL;
    }

    /*
     * We have now extracted (but not converted) the input arguments.
     * To simplify overrides, extract all other arguments (as objects only)
     */
    PyObject *out_obj = NULL, *where_obj = NULL;
    PyObject *axes_obj = NULL, *axis_obj = NULL;
    PyObject *keepdims_obj = NULL, *casting_obj = NULL, *order_obj = NULL;
    PyObject *subok_obj = NULL, *signature_obj = NULL, *sig_obj = NULL;

Review comment (suggestion):
For the deprecation warning, I would suggest not worrying about adapting it to the name, but just keep it simple. Also, it should make clear why it is being deprecated. Maybe,
```
                "Passing more than 2 positional arguments to np.maximum "
                "and np.minimum'is deprecated. If you meant to use the third "
                "argument as an output, use the 'out' keyword argument instead. "
                "If you hoped to work with more than 2 inputs, combine them "
                "into a single array and get the extrema for the relevant axis."
```

Code after:
        }
        for (int i = nin; i < nop; i++) {
            PyObject *tmp;
            if (i < (int)len_args) {
                tmp = args[i];
                if (tmp == Py_Ellipsis) {
                    PyErr_SetString(PyExc_TypeError,
                        "out=... is only allowed as a keyword argument.");
                    goto fail;
                }
                if (tmp != Py_None) {
                    all_none = NPY_FALSE;
                }
            }
            else {
                tmp = Py_None;
            }
            Py_INCREF(tmp);
            PyTuple_SET_ITEM(full_args.out, i-nin, tmp);
        }

        /* Extra positional args but no keywords */
        /* DEPRECATED NumPy 2.4, 2025-08 */
        if ((PyObject *)ufunc == n_ops.maximum || (PyObject *)ufunc == n_ops.minimum) {
            
            if (DEPRECATE(
                "Passing more than 2 positional arguments to np.maximum and np.minimum "
                "is deprecated. If you meant to use the third argument as an output, " 
                "use the `out` keyword argument instead. If you hoped to work with "
                "more than 2 inputs, combine them into a single array and get the extrema "
                "for the relevant axis.") < 0) {
                return NULL;
            }
        }
        
        if (all_none) {
            Py_SETREF(full_args.out, NULL);
        }
    }
    else {
        full_args.out = NULL;
    }

    /*
     * We have now extracted (but not converted) the input arguments.
     * To simplify overrides, extract all other arguments (as objects only)
     */
    PyObject *out_obj = NULL, *where_obj = NULL;
    PyObject *axes_obj = NULL, *axis_obj = NULL;
    PyObject *keepdims_obj = NULL, *casting_obj = NULL, *order_obj = NULL;
    PyObject *subok_obj = NULL, *signature_obj = NULL, *sig_obj = NULL;