Lines Matching +full:is +full:- +full:callable
33 _Py_CheckFunctionResult(PyThreadState *tstate, PyObject *callable, in _Py_CheckFunctionResult() argument
36 assert((callable != NULL) ^ (where != NULL)); in _Py_CheckFunctionResult()
40 if (callable) in _Py_CheckFunctionResult()
43 callable); in _Py_CheckFunctionResult()
49 /* Ensure that the bug is caught in debug mode. in _Py_CheckFunctionResult()
60 if (callable) { in _Py_CheckFunctionResult()
63 "%R returned a result with an exception set", callable); in _Py_CheckFunctionResult()
71 /* Ensure that the bug is caught in debug mode. in _Py_CheckFunctionResult()
91 slot_name, Py_TYPE(obj)->tp_name); in _Py_CheckSlotResult()
99 slot_name, Py_TYPE(obj)->tp_name); in _Py_CheckSlotResult()
106 /* --- Core PyObject call functions ------------------------------- */
108 /* Call a callable Python object without any arguments */
117 _PyObject_FastCallDictTstate(PyThreadState *tstate, PyObject *callable, in _PyObject_FastCallDictTstate() argument
121 assert(callable != NULL); in _PyObject_FastCallDictTstate()
133 vectorcallfunc func = _PyVectorcall_Function(callable); in _PyObject_FastCallDictTstate()
136 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwargs); in _PyObject_FastCallDictTstate()
141 res = func(callable, args, nargsf, NULL); in _PyObject_FastCallDictTstate()
152 res = func(callable, newargs, in _PyObject_FastCallDictTstate()
156 return _Py_CheckFunctionResult(tstate, callable, res, NULL); in _PyObject_FastCallDictTstate()
161 PyObject_VectorcallDict(PyObject *callable, PyObject *const *args, in PyObject_VectorcallDict() argument
165 return _PyObject_FastCallDictTstate(tstate, callable, args, nargsf, kwargs); in PyObject_VectorcallDict()
170 _PyObject_MakeTpCall(PyThreadState *tstate, PyObject *callable, in _PyObject_MakeTpCall() argument
180 ternaryfunc call = Py_TYPE(callable)->tp_call; in _PyObject_MakeTpCall()
183 "'%.200s' object is not callable", in _PyObject_MakeTpCall()
184 Py_TYPE(callable)->tp_name); in _PyObject_MakeTpCall()
215 (PyCFunctionWithKeywords)call, callable, argstuple, kwdict); in _PyObject_MakeTpCall()
224 return _Py_CheckFunctionResult(tstate, callable, result, NULL); in _PyObject_MakeTpCall()
229 PyVectorcall_Function(PyObject *callable) in PyVectorcall_Function() argument
231 return _PyVectorcall_FunctionInline(callable); in PyVectorcall_Function()
237 PyObject *callable, PyObject *tuple, PyObject *kwargs) in _PyVectorcall_Call() argument
245 return func(callable, _PyTuple_ITEMS(tuple), nargs, NULL); in _PyVectorcall_Call()
257 PyObject *result = func(callable, args, in _PyVectorcall_Call()
261 return _Py_CheckFunctionResult(tstate, callable, result, NULL); in _PyVectorcall_Call()
266 PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *kwargs) in PyVectorcall_Call() argument
272 Py_ssize_t offset = Py_TYPE(callable)->tp_vectorcall_offset; in PyVectorcall_Call()
276 Py_TYPE(callable)->tp_name); in PyVectorcall_Call()
279 assert(PyCallable_Check(callable)); in PyVectorcall_Call()
282 memcpy(&func, (char *) callable + offset, sizeof(func)); in PyVectorcall_Call()
286 Py_TYPE(callable)->tp_name); in PyVectorcall_Call()
290 return _PyVectorcall_Call(tstate, func, callable, tuple, kwargs); in PyVectorcall_Call()
295 PyObject_Vectorcall(PyObject *callable, PyObject *const *args, in PyObject_Vectorcall() argument
299 return _PyObject_VectorcallTstate(tstate, callable, in PyObject_Vectorcall()
313 _PyObject_Call(PyThreadState *tstate, PyObject *callable, in _PyObject_Call() argument
326 vectorcallfunc vector_func = _PyVectorcall_Function(callable); in _PyObject_Call()
328 return _PyVectorcall_Call(tstate, vector_func, callable, args, kwargs); in _PyObject_Call()
331 call = Py_TYPE(callable)->tp_call; in _PyObject_Call()
334 "'%.200s' object is not callable", in _PyObject_Call()
335 Py_TYPE(callable)->tp_name); in _PyObject_Call()
343 result = (*call)(callable, args, kwargs); in _PyObject_Call()
347 return _Py_CheckFunctionResult(tstate, callable, result, NULL); in _PyObject_Call()
352 PyObject_Call(PyObject *callable, PyObject *args, PyObject *kwargs) in PyObject_Call() argument
355 return _PyObject_Call(tstate, callable, args, kwargs); in PyObject_Call()
360 PyCFunction_Call(PyObject *callable, PyObject *args, PyObject *kwargs) in PyCFunction_Call() argument
363 return _PyObject_Call(tstate, callable, args, kwargs); in PyCFunction_Call()
380 /* --- PyFunction call functions ---------------------------------- */
392 if (((PyCodeObject *)f->func_code)->co_flags & CO_OPTIMIZED) { in _PyFunction_Vectorcall()
396 return _PyEval_Vector(tstate, f, f->func_globals, stack, nargs, kwnames); in _PyFunction_Vectorcall()
400 /* --- More complex call functions -------------------------------- */
402 /* External interface to call any callable object.
405 PyEval_CallObjectWithKeywords(PyObject *callable, in PyEval_CallObjectWithKeywords() argument
412 PyTuple_New() fails, and so the original exception is lost. */ in PyEval_CallObjectWithKeywords()
429 return _PyObject_FastCallDictTstate(tstate, callable, NULL, 0, kwargs); in PyEval_CallObjectWithKeywords()
432 return _PyObject_Call(tstate, callable, args, kwargs); in PyEval_CallObjectWithKeywords()
438 PyObject_CallObject(PyObject *callable, PyObject *args) in PyObject_CallObject() argument
443 return _PyObject_CallNoArgsTstate(tstate, callable); in PyObject_CallObject()
450 return _PyObject_Call(tstate, callable, args, NULL); in PyObject_CallObject()
454 /* Call callable(obj, *args, **kwargs). */
456 _PyObject_Call_Prepend(PyThreadState *tstate, PyObject *callable, in _PyObject_Call_Prepend() argument
482 PyObject *result = _PyObject_FastCallDictTstate(tstate, callable, in _PyObject_Call_Prepend()
492 /* --- Call with a format string ---------------------------------- */
495 _PyObject_CallFunctionVa(PyThreadState *tstate, PyObject *callable, in _PyObject_CallFunctionVa() argument
504 if (callable == NULL) { in _PyObject_CallFunctionVa()
509 return _PyObject_CallNoArgsTstate(tstate, callable); in _PyObject_CallFunctionVa()
526 - PyObject_CallFunction(func, "O", tuple) calls func(*tuple) in _PyObject_CallFunctionVa()
527 - PyObject_CallFunction(func, "(OOO)", arg1, arg2, arg3) calls in _PyObject_CallFunctionVa()
530 result = _PyObject_VectorcallTstate(tstate, callable, in _PyObject_CallFunctionVa()
536 result = _PyObject_VectorcallTstate(tstate, callable, in _PyObject_CallFunctionVa()
551 PyObject_CallFunction(PyObject *callable, const char *format, ...) in PyObject_CallFunction() argument
558 result = _PyObject_CallFunctionVa(tstate, callable, format, va, 0); in PyObject_CallFunction()
565 /* PyEval_CallFunction is exact copy of PyObject_CallFunction.
566 * This function is kept for backward compatibility.
569 PyEval_CallFunction(PyObject *callable, const char *format, ...) in PyEval_CallFunction() argument
576 result = _PyObject_CallFunctionVa(tstate, callable, format, va, 0); in PyEval_CallFunction()
584 _PyObject_CallFunction_SizeT(PyObject *callable, const char *format, ...) in _PyObject_CallFunction_SizeT() argument
590 PyObject *result = _PyObject_CallFunctionVa(tstate, callable, format, va, 1); in _PyObject_CallFunction_SizeT()
598 callmethod(PyThreadState *tstate, PyObject* callable, const char *format, va_list va, int is_size_t) in callmethod() argument
600 assert(callable != NULL); in callmethod()
601 if (!PyCallable_Check(callable)) { in callmethod()
603 "attribute of type '%.200s' is not callable", in callmethod()
604 Py_TYPE(callable)->tp_name); in callmethod()
608 return _PyObject_CallFunctionVa(tstate, callable, format, va, is_size_t); in callmethod()
620 PyObject *callable = PyObject_GetAttrString(obj, name); in PyObject_CallMethod() local
621 if (callable == NULL) { in PyObject_CallMethod()
627 PyObject *retval = callmethod(tstate, callable, format, va, 0); in PyObject_CallMethod()
630 Py_DECREF(callable); in PyObject_CallMethod()
635 /* PyEval_CallMethod is exact copy of PyObject_CallMethod.
636 * This function is kept for backward compatibility.
646 PyObject *callable = PyObject_GetAttrString(obj, name); in PyEval_CallMethod() local
647 if (callable == NULL) { in PyEval_CallMethod()
653 PyObject *retval = callmethod(tstate, callable, format, va, 0); in PyEval_CallMethod()
656 Py_DECREF(callable); in PyEval_CallMethod()
670 PyObject *callable = PyObject_GetAttr(obj, name); in _PyObject_CallMethod() local
671 if (callable == NULL) { in _PyObject_CallMethod()
677 PyObject *retval = callmethod(tstate, callable, format, va, 1); in _PyObject_CallMethod()
680 Py_DECREF(callable); in _PyObject_CallMethod()
694 PyObject *callable = _PyObject_GetAttrId(obj, name); in _PyObject_CallMethodId() local
695 if (callable == NULL) { in _PyObject_CallMethodId()
701 PyObject *retval = callmethod(tstate, callable, format, va, 0); in _PyObject_CallMethodId()
704 Py_DECREF(callable); in _PyObject_CallMethodId()
709 PyObject * _PyObject_CallMethodFormat(PyThreadState *tstate, PyObject *callable, in _PyObject_CallMethodFormat() argument
714 PyObject *retval = callmethod(tstate, callable, format, va, 0); in _PyObject_CallMethodFormat()
729 PyObject *callable = PyObject_GetAttrString(obj, name); in _PyObject_CallMethod_SizeT() local
730 if (callable == NULL) { in _PyObject_CallMethod_SizeT()
736 PyObject *retval = callmethod(tstate, callable, format, va, 1); in _PyObject_CallMethod_SizeT()
739 Py_DECREF(callable); in _PyObject_CallMethod_SizeT()
753 PyObject *callable = _PyObject_GetAttrId(obj, name); in _PyObject_CallMethodId_SizeT() local
754 if (callable == NULL) { in _PyObject_CallMethodId_SizeT()
760 PyObject *retval = callmethod(tstate, callable, format, va, 1); in _PyObject_CallMethodId_SizeT()
763 Py_DECREF(callable); in _PyObject_CallMethodId_SizeT()
768 /* --- Call with "..." arguments ---------------------------------- */
772 PyObject *callable, va_list vargs) in object_vacall() argument
781 if (callable == NULL) { in object_vacall()
819 result = _PyObject_VectorcallTstate(tstate, callable, stack, nargs, NULL); in object_vacall()
837 PyObject *callable = NULL; in PyObject_VectorcallMethod() local
839 int unbound = _PyObject_GetMethod(args[0], name, &callable); in PyObject_VectorcallMethod()
840 if (callable == NULL) { in PyObject_VectorcallMethod()
846 * that would be interpreted as allowing to change args[-1] */ in PyObject_VectorcallMethod()
851 * args[-1] in the onward call is args[0] here. */ in PyObject_VectorcallMethod()
853 nargsf--; in PyObject_VectorcallMethod()
855 PyObject *result = _PyObject_VectorcallTstate(tstate, callable, in PyObject_VectorcallMethod()
857 Py_DECREF(callable); in PyObject_VectorcallMethod()
870 PyObject *callable = NULL; in PyObject_CallMethodObjArgs() local
871 int is_method = _PyObject_GetMethod(obj, name, &callable); in PyObject_CallMethodObjArgs()
872 if (callable == NULL) { in PyObject_CallMethodObjArgs()
879 PyObject *result = object_vacall(tstate, obj, callable, vargs); in PyObject_CallMethodObjArgs()
882 Py_DECREF(callable); in PyObject_CallMethodObjArgs()
900 PyObject *callable = NULL; in _PyObject_CallMethodIdObjArgs() local
901 int is_method = _PyObject_GetMethod(obj, oname, &callable); in _PyObject_CallMethodIdObjArgs()
902 if (callable == NULL) { in _PyObject_CallMethodIdObjArgs()
909 PyObject *result = object_vacall(tstate, obj, callable, vargs); in _PyObject_CallMethodIdObjArgs()
912 Py_DECREF(callable); in _PyObject_CallMethodIdObjArgs()
918 PyObject_CallFunctionObjArgs(PyObject *callable, ...) in PyObject_CallFunctionObjArgs() argument
924 va_start(vargs, callable); in PyObject_CallFunctionObjArgs()
925 result = object_vacall(tstate, NULL, callable, vargs); in PyObject_CallFunctionObjArgs()
932 /* --- PyStack functions ------------------------------------------ */
952 This also checks that all keyword names are strings. If not, a TypeError is
970 * non-negative signed integers, so their difference fits in the type. */ in _PyStack_UnpackDict()
971 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(args[0]) - 1; in _PyStack_UnpackDict()
972 if (nargs > maxnargs - nkwargs) { in _PyStack_UnpackDict()
1000 to change its size. It's a deliberate choice for speed, this function is in _PyStack_UnpackDict()
1006 keys_are_strings &= Py_TYPE(key)->tp_flags; in _PyStack_UnpackDict()
1015 * flag is set for all keys. Otherwise, keys_are_strings equals 0. in _PyStack_UnpackDict()
1038 PyMem_Free((PyObject **)stack - 1); in _PyStack_UnpackDict_Free()