Document kwnames in _PyObject_FastCallKeywords() and _PyStack_AsDict()

Issue #27213.
This commit is contained in:
Victor Stinner 2016-09-12 13:37:07 +02:00
parent b8d768b019
commit 57f91ac95a
4 changed files with 48 additions and 25 deletions

View file

@ -276,6 +276,11 @@ _PyCFunction_FastCallKeywords(PyObject *func, PyObject **stack,
Py_ssize_t nkwargs;
assert(PyCFunction_Check(func));
assert(nargs >= 0);
assert(kwnames == NULL || PyTuple_CheckExact(kwnames));
assert((nargs == 0 && nkwargs == 0) || stack != NULL);
/* kwnames must only contains str strings, no subclass, and all keys must
be unique */
nkwargs = (kwnames == NULL) ? 0 : PyTuple_GET_SIZE(kwnames);
if (nkwargs > 0) {