mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
prevent the dict constructor from accepting non-string keyword args #8419
This adds PyArg_ValidateKeywordArguments, which checks that keyword arguments are all strings, using an optimized method if possible.
This commit is contained in:
parent
b962171414
commit
fb88636199
7 changed files with 57 additions and 2 deletions
|
@ -366,6 +366,13 @@ and the following format units are left untouched.
|
|||
va_list rather than a variable number of arguments.
|
||||
|
||||
|
||||
.. cfunction:: int PyArg_ValidateKeywordArguments(PyObject *)
|
||||
|
||||
Ensure that the keys in the keywords argument dictionary are strings. This
|
||||
is only needed if :cfunc:`PyArg_ParseTupleAndKeywords` is not used, since the
|
||||
latter already does this check.
|
||||
|
||||
|
||||
.. XXX deprecated, will be removed
|
||||
.. cfunction:: int PyArg_Parse(PyObject *args, const char *format, ...)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue