summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-09-12 11:37:07 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-09-12 11:37:07 (GMT)
commit57f91ac95aec1922ba104019a81a6508485862c4 (patch)
treecbf2300bab2d6c2bcb6f0b08b30be4ce2290c4e2 /Python
parentb8d768b0199c55d408f5c8b86d14555aa7be9f98 (diff)
downloadcpython-57f91ac95aec1922ba104019a81a6508485862c4.zip
cpython-57f91ac95aec1922ba104019a81a6508485862c4.tar.gz
cpython-57f91ac95aec1922ba104019a81a6508485862c4.tar.bz2
Document kwnames in _PyObject_FastCallKeywords() and _PyStack_AsDict()
Issue #27213.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c5
1 files changed, 5 insertions, 0 deletions
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 @@ 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);