Commit 3f745bf1 authored by Victor Stinner's avatar Victor Stinner

PyEval_CallObjectWithKeywords() uses fast call

Issue #27128: Modify PyEval_CallObjectWithKeywords() to use
_PyObject_FastCall() when args==NULL and kw==NULL. It avoids the creation of a
temporary empty tuple for positional arguments.
parent 9be7e7b5
......@@ -4592,6 +4592,10 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw)
#endif
if (arg == NULL) {
if (kw == NULL) {
return _PyObject_FastCall(func, NULL, 0, 0);
}
arg = PyTuple_New(0);
if (arg == NULL)
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment