static int
slot_sq_contains(PyObject *self, PyObject *value)
{
- PyObject *func, *res, *args;
+ PyObject *func, *res;
int result = -1;
_Py_IDENTIFIER(__contains__);
return -1;
}
if (func != NULL) {
- args = PyTuple_Pack(1, value);
- if (args == NULL)
- res = NULL;
- else {
- res = PyObject_Call(func, args, NULL);
- Py_DECREF(args);
- }
+ res = _PyObject_FastCall(func, &value, 1, NULL);
Py_DECREF(func);
if (res != NULL) {
result = PyObject_IsTrue(res);
static PyObject *
slot_tp_richcompare(PyObject *self, PyObject *other, int op)
{
- PyObject *func, *args, *res;
+ PyObject *func, *res;
func = lookup_method(self, &name_op[op]);
if (func == NULL) {
PyErr_Clear();
Py_RETURN_NOTIMPLEMENTED;
}
- args = PyTuple_Pack(1, other);
- if (args == NULL)
- res = NULL;
- else {
- res = PyObject_Call(func, args, NULL);
- Py_DECREF(args);
- }
+ res = _PyObject_FastCall(func, &other, 1, NULL);
Py_DECREF(func);
return res;
}