• Home
  • Raw
  • Download

Lines Matching refs:pto

107     partialobject *pto;  in partial_new()  local
123 pto = (partialobject *)type->tp_alloc(type, 0); in partial_new()
124 if (pto == NULL) in partial_new()
127 pto->fn = func; in partial_new()
129 pto->args = PyTuple_GetSlice(args, 1, PY_SSIZE_T_MAX); in partial_new()
130 if (pto->args == NULL) { in partial_new()
131 Py_DECREF(pto); in partial_new()
134 pto->kw = (kw != NULL) ? PyDict_Copy(kw) : PyDict_New(); in partial_new()
135 if (pto->kw == NULL) { in partial_new()
136 Py_DECREF(pto); in partial_new()
140 return (PyObject *)pto; in partial_new()
144 partial_dealloc(partialobject *pto) in partial_dealloc() argument
147 PyObject_GC_UnTrack(pto); in partial_dealloc()
148 if (pto->weakreflist != NULL) in partial_dealloc()
149 PyObject_ClearWeakRefs((PyObject *) pto); in partial_dealloc()
150 Py_XDECREF(pto->fn); in partial_dealloc()
151 Py_XDECREF(pto->args); in partial_dealloc()
152 Py_XDECREF(pto->kw); in partial_dealloc()
153 Py_XDECREF(pto->dict); in partial_dealloc()
154 Py_TYPE(pto)->tp_free(pto); in partial_dealloc()
158 partial_call(partialobject *pto, PyObject *args, PyObject *kw) in partial_call() argument
163 assert (PyCallable_Check(pto->fn)); in partial_call()
164 assert (PyTuple_Check(pto->args)); in partial_call()
165 assert (PyDict_Check(pto->kw)); in partial_call()
167 if (PyTuple_GET_SIZE(pto->args) == 0) { in partial_call()
171 argappl = pto->args; in partial_call()
172 Py_INCREF(pto->args); in partial_call()
174 argappl = PySequence_Concat(pto->args, args); in partial_call()
180 if (PyDict_Size(pto->kw) == 0) { in partial_call()
184 kwappl = PyDict_Copy(pto->kw); in partial_call()
198 ret = PyObject_Call(pto->fn, argappl, kwappl); in partial_call()
205 partial_traverse(partialobject *pto, visitproc visit, void *arg) in partial_traverse() argument
207 Py_VISIT(pto->fn); in partial_traverse()
208 Py_VISIT(pto->args); in partial_traverse()
209 Py_VISIT(pto->kw); in partial_traverse()
210 Py_VISIT(pto->dict); in partial_traverse()
230 partial_get_dict(partialobject *pto) in partial_get_dict() argument
232 if (pto->dict == NULL) { in partial_get_dict()
233 pto->dict = PyDict_New(); in partial_get_dict()
234 if (pto->dict == NULL) in partial_get_dict()
237 Py_INCREF(pto->dict); in partial_get_dict()
238 return pto->dict; in partial_get_dict()
242 partial_set_dict(partialobject *pto, PyObject *value) in partial_set_dict() argument
258 tmp = pto->dict; in partial_set_dict()
260 pto->dict = value; in partial_set_dict()
278 partial_reduce(partialobject *pto, PyObject *unused) in partial_reduce() argument
280 return Py_BuildValue("O(O)(OOOO)", Py_TYPE(pto), pto->fn, pto->fn, in partial_reduce()
281 pto->args, pto->kw, in partial_reduce()
282 pto->dict ? pto->dict : Py_None); in partial_reduce()
286 partial_setstate(partialobject *pto, PyObject *state) in partial_setstate() argument
324 Py_SETREF(pto->fn, fn); in partial_setstate()
325 Py_SETREF(pto->args, fnargs); in partial_setstate()
326 Py_SETREF(pto->kw, kw); in partial_setstate()
327 Py_XSETREF(pto->dict, dict); in partial_setstate()