mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +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
|
|
@ -126,6 +126,7 @@ PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key);
|
|||
PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, long hash);
|
||||
PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused);
|
||||
PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp);
|
||||
PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp);
|
||||
|
||||
/* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */
|
||||
PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue