From 57f91ac95aec1922ba104019a81a6508485862c4 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 12 Sep 2016 13:37:07 +0200 Subject: Document kwnames in _PyObject_FastCallKeywords() and _PyStack_AsDict() Issue #27213. --- Objects/methodobject.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Objects/methodobject.c') diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 90c473ee97..19e8114d4a 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -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) { -- cgit v1.2.1