summaryrefslogtreecommitdiff
path: root/Objects/methodobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-09-12 13:37:07 +0200
committerVictor Stinner <victor.stinner@gmail.com>2016-09-12 13:37:07 +0200
commit57f91ac95aec1922ba104019a81a6508485862c4 (patch)
treecbf2300bab2d6c2bcb6f0b08b30be4ce2290c4e2 /Objects/methodobject.c
parentb8d768b0199c55d408f5c8b86d14555aa7be9f98 (diff)
downloadcpython-git-57f91ac95aec1922ba104019a81a6508485862c4.tar.gz
Document kwnames in _PyObject_FastCallKeywords() and _PyStack_AsDict()
Issue #27213.
Diffstat (limited to 'Objects/methodobject.c')
-rw-r--r--Objects/methodobject.c5
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) {