Lines Matching refs:mc
1487 methodcallerobject *mc; in methodcaller_new() local
1505 mc = PyObject_GC_New(methodcallerobject, (PyTypeObject *)state->methodcaller_type); in methodcaller_new()
1506 if (mc == NULL) { in methodcaller_new()
1513 mc->name = name; in methodcaller_new()
1516 mc->kwds = kwds; in methodcaller_new()
1518 mc->args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); in methodcaller_new()
1519 if (mc->args == NULL) { in methodcaller_new()
1520 Py_DECREF(mc); in methodcaller_new()
1524 PyObject_GC_Track(mc); in methodcaller_new()
1525 return (PyObject *)mc; in methodcaller_new()
1529 methodcaller_clear(methodcallerobject *mc) in methodcaller_clear() argument
1531 Py_CLEAR(mc->name); in methodcaller_clear()
1532 Py_CLEAR(mc->args); in methodcaller_clear()
1533 Py_CLEAR(mc->kwds); in methodcaller_clear()
1538 methodcaller_dealloc(methodcallerobject *mc) in methodcaller_dealloc() argument
1540 PyTypeObject *tp = Py_TYPE(mc); in methodcaller_dealloc()
1541 PyObject_GC_UnTrack(mc); in methodcaller_dealloc()
1542 (void)methodcaller_clear(mc); in methodcaller_dealloc()
1543 tp->tp_free(mc); in methodcaller_dealloc()
1548 methodcaller_traverse(methodcallerobject *mc, visitproc visit, void *arg) in methodcaller_traverse() argument
1550 Py_VISIT(mc->name); in methodcaller_traverse()
1551 Py_VISIT(mc->args); in methodcaller_traverse()
1552 Py_VISIT(mc->kwds); in methodcaller_traverse()
1553 Py_VISIT(Py_TYPE(mc)); in methodcaller_traverse()
1558 methodcaller_call(methodcallerobject *mc, PyObject *args, PyObject *kw) in methodcaller_call() argument
1567 method = PyObject_GetAttr(obj, mc->name); in methodcaller_call()
1570 result = PyObject_Call(method, mc->args, mc->kwds); in methodcaller_call()
1576 methodcaller_repr(methodcallerobject *mc) in methodcaller_repr() argument
1580 int status = Py_ReprEnter((PyObject *)mc); in methodcaller_repr()
1584 return PyUnicode_FromFormat("%s(...)", Py_TYPE(mc)->tp_name); in methodcaller_repr()
1587 numkwdargs = mc->kwds != NULL ? PyDict_GET_SIZE(mc->kwds) : 0; in methodcaller_repr()
1588 numposargs = PyTuple_GET_SIZE(mc->args); in methodcaller_repr()
1592 repr = PyUnicode_FromFormat("%s(%R)", Py_TYPE(mc)->tp_name, mc->name); in methodcaller_repr()
1593 Py_ReprLeave((PyObject *)mc); in methodcaller_repr()
1599 Py_ReprLeave((PyObject *)mc); in methodcaller_repr()
1604 PyObject *onerepr = PyObject_Repr(PyTuple_GET_ITEM(mc->args, i)); in methodcaller_repr()
1613 while (PyDict_Next(mc->kwds, &pos, &key, &value)) { in methodcaller_repr()
1641 repr = PyUnicode_FromFormat("%s(%R, %U)", Py_TYPE(mc)->tp_name, in methodcaller_repr()
1642 mc->name, joinedargreprs); in methodcaller_repr()
1647 Py_ReprLeave((PyObject *)mc); in methodcaller_repr()
1652 methodcaller_reduce(methodcallerobject *mc, PyObject *Py_UNUSED(ignored)) in methodcaller_reduce() argument
1655 if (!mc->kwds || PyDict_GET_SIZE(mc->kwds) == 0) { in methodcaller_reduce()
1657 Py_ssize_t callargcount = PyTuple_GET_SIZE(mc->args); in methodcaller_reduce()
1661 Py_INCREF(mc->name); in methodcaller_reduce()
1662 PyTuple_SET_ITEM(newargs, 0, mc->name); in methodcaller_reduce()
1664 PyObject *arg = PyTuple_GET_ITEM(mc->args, i); in methodcaller_reduce()
1668 return Py_BuildValue("ON", Py_TYPE(mc), newargs); in methodcaller_reduce()
1685 newargs[0] = (PyObject *)Py_TYPE(mc); in methodcaller_reduce()
1686 newargs[1] = mc->name; in methodcaller_reduce()
1687 constructor = PyObject_VectorcallDict(partial, newargs, 2, mc->kwds); in methodcaller_reduce()
1690 return Py_BuildValue("NO", constructor, mc->args); in methodcaller_reduce()