Document kwnames in _PyObject_FastCallKeywords() and _PyStack_AsDict()
Issue #27213.
diff --git a/Python/ceval.c b/Python/ceval.c
index c9ac03f..ff36d36 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4863,7 +4863,12 @@
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);