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

@ -4863,7 +4863,12 @@ fast_function(PyObject *func, PyObject **stack,
Py_ssize_t nkwargs = (kwnames == NULL) ? 0 : PyTuple_GET_SIZE(kwnames);
Py_ssize_t nd;
assert(PyFunction_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 */
PCALL(PCALL_FUNCTION);
PCALL(PCALL_FAST_FUNCTION);