diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-09-12 13:37:07 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-09-12 13:37:07 +0200 |
commit | af28671b2c1ff0e7b5c27f588b5620de8d17e676 (patch) | |
tree | 96710deee1d290d4282cc0072faf733921e2f500 /Objects/methodobject.c | |
parent | 92011c90edeea1c883b0811039c3c9d102ccfbd9 (diff) | |
download | cpython-af28671b2c1ff0e7b5c27f588b5620de8d17e676.tar.gz |
Document kwnames in _PyObject_FastCallKeywords() and _PyStack_AsDict()
Issue #27213.
Diffstat (limited to 'Objects/methodobject.c')
-rw-r--r-- | Objects/methodobject.c | 5 |
1 files changed, 5 insertions, 0 deletions
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) { |