summaryrefslogtreecommitdiff
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-08-22 23:15:44 +0200
committerVictor Stinner <victor.stinner@gmail.com>2016-08-22 23:15:44 +0200
commit9dae6156b5e3127cb8bfaa1bd36cecadaad5d60b (patch)
tree8c791586bd84fd42afbbc75aec2a32b2fdf6aef0 /Objects/abstract.c
parentde03c6d8066496680a1ea99ff9e67e28852b0007 (diff)
downloadcpython-9dae6156b5e3127cb8bfaa1bd36cecadaad5d60b.tar.gz
_PyFunction_FastCallDict() supports keyword args
Issue #27809: * Rename _PyFunction_FastCall() to _PyFunction_FastCallDict() * Rename _PyCFunction_FastCall() to _PyCFunction_FastCallDict() * _PyFunction_FastCallDict() now supports keyword arguments
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 2ce7f327e9..0e67693fcf 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2255,7 +2255,8 @@ _PyStack_AsTuple(PyObject **stack, Py_ssize_t nargs)
}
PyObject *
-_PyObject_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs)
+_PyObject_FastCallDict(PyObject *func, PyObject **args, int nargs,
+ PyObject *kwargs)
{
ternaryfunc call;
PyObject *result = NULL;
@@ -2268,19 +2269,17 @@ _PyObject_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwa
assert(func != NULL);
assert(nargs >= 0);
assert(nargs == 0 || args != NULL);
- /* issue #27128: support for keywords will come later:
- _PyFunction_FastCall() doesn't support keyword arguments yet */
- assert(kwargs == NULL);
+ assert(kwargs == NULL || PyDict_Check(kwargs));
if (Py_EnterRecursiveCall(" while calling a Python object")) {
return NULL;
}
if (PyFunction_Check(func)) {
- result = _PyFunction_FastCall(func, args, nargs, kwargs);
+ result = _PyFunction_FastCallDict(func, args, nargs, kwargs);
}
else if (PyCFunction_Check(func)) {
- result = _PyCFunction_FastCall(func, args, nargs, kwargs);
+ result = _PyCFunction_FastCallDict(func, args, nargs, kwargs);
}
else {
PyObject *tuple;