Lines Matching defs:args
15 functools_reduce(PyObject *self, PyObject *args)
19 if (!PyArg_UnpackTuple(args, "reduce", 2, 3, &func, &seq, &result))
32 if ((args = PyTuple_New(2)) == NULL)
38 if (args->ob_refcnt > 1) {
39 Py_DECREF(args);
40 if ((args = PyTuple_New(2)) == NULL)
54 PyTuple_SetItem(args, 0, result);
55 PyTuple_SetItem(args, 1, op2);
56 if ((result = PyEval_CallObject(func, args)) == NULL)
61 Py_DECREF(args);
71 Py_XDECREF(args);
95 PyObject *args;
104 partial_new(PyTypeObject *type, PyObject *args, PyObject *kw)
109 if (PyTuple_GET_SIZE(args) < 1) {
115 func = PyTuple_GET_ITEM(args, 0);
129 pto->args = PyTuple_GetSlice(args, 1, PY_SSIZE_T_MAX);
130 if (pto->args == NULL) {
155 Py_XDECREF(pto->args);
162 partial_call(partialobject *pto, PyObject *args, PyObject *kw)
168 assert (PyTuple_Check(pto->args));
171 if (PyTuple_GET_SIZE(pto->args) == 0) {
172 argappl = args;
173 Py_INCREF(args);
174 } else if (PyTuple_GET_SIZE(args) == 0) {
175 argappl = pto->args;
176 Py_INCREF(pto->args);
178 argappl = PySequence_Concat(pto->args, args);
211 Py_VISIT(pto->args);
218 "partial(func, *args, **keywords) - new function with partial application\n\
225 {"args", T_OBJECT, OFF(args), READONLY,
284 pto->args, pto->kw,
296 Py_XDECREF(pto->args);
300 pto->args = fnargs;