mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
gh-141726: Add PyDict_SetDefaultRef() to the Stable ABI (#141727)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
parent
52f70a6f60
commit
afa0badcc5
7 changed files with 18 additions and 10 deletions
|
|
@ -39,16 +39,6 @@ Py_DEPRECATED(3.14) PyAPI_FUNC(PyObject *) _PyDict_GetItemStringWithError(PyObje
|
|||
PyAPI_FUNC(PyObject *) PyDict_SetDefault(
|
||||
PyObject *mp, PyObject *key, PyObject *defaultobj);
|
||||
|
||||
// Inserts `key` with a value `default_value`, if `key` is not already present
|
||||
// in the dictionary. If `result` is not NULL, then the value associated
|
||||
// with `key` is returned in `*result` (either the existing value, or the now
|
||||
// inserted `default_value`).
|
||||
// Returns:
|
||||
// -1 on error
|
||||
// 0 if `key` was not present and `default_value` was inserted
|
||||
// 1 if `key` was present and `default_value` was not inserted
|
||||
PyAPI_FUNC(int) PyDict_SetDefaultRef(PyObject *mp, PyObject *key, PyObject *default_value, PyObject **result);
|
||||
|
||||
/* Get the number of items of a dictionary. */
|
||||
static inline Py_ssize_t PyDict_GET_SIZE(PyObject *op) {
|
||||
PyDictObject *mp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue