| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,16 +39,6 @@ Py_DEPRECATED(3.14) PyAPI_FUNC(PyObject *) _PyDict_GetItemStringWithError(PyObje | |||
| 39 | 39 | PyAPI_FUNC(PyObject *) PyDict_SetDefault( | |
| 40 | 40 | PyObject *mp, PyObject *key, PyObject *defaultobj); | |
| 41 | 41 | ||
| 42 | - // Inserts `key` with a value `default_value`, if `key` is not already present | ||
| 43 | - // in the dictionary. If `result` is not NULL, then the value associated | ||
| 44 | - // with `key` is returned in `*result` (either the existing value, or the now | ||
| 45 | - // inserted `default_value`). | ||
| 46 | - // Returns: | ||
| 47 | - // -1 on error | ||
| 48 | - // 0 if `key` was not present and `default_value` was inserted | ||
| 49 | - // 1 if `key` was present and `default_value` was not inserted | ||
| 50 | - PyAPI_FUNC(int) PyDict_SetDefaultRef(PyObject *mp, PyObject *key, PyObject *default_value, PyObject **result); | ||
| 51 | - | ||
| 52 | 42 | /* Get the number of items of a dictionary. */ | |
| 53 | 43 | static inline Py_ssize_t PyDict_GET_SIZE(PyObject *op) { | |
| 54 | 44 | PyDictObject *mp; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,6 +68,18 @@ PyAPI_FUNC(int) PyDict_GetItemRef(PyObject *mp, PyObject *key, PyObject **result | |||
| 68 | 68 | PyAPI_FUNC(int) PyDict_GetItemStringRef(PyObject *mp, const char *key, PyObject **result); | |
| 69 | 69 | #endif | |
| 70 | 70 | ||
| 71 | + #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030F0000 | ||
| 72 | + // Inserts `key` with a value `default_value`, if `key` is not already present | ||
| 73 | + // in the dictionary. If `result` is not NULL, then the value associated | ||
| 74 | + // with `key` is returned in `*result` (either the existing value, or the now | ||
| 75 | + // inserted `default_value`). | ||
| 76 | + // Returns: | ||
| 77 | + // -1 on error | ||
| 78 | + // 0 if `key` was not present and `default_value` was inserted | ||
| 79 | + // 1 if `key` was present and `default_value` was not inserted | ||
| 80 | + PyAPI_FUNC(int) PyDict_SetDefaultRef(PyObject *mp, PyObject *key, PyObject *default_value, PyObject **result); | ||
| 81 | + #endif | ||
| 82 | + | ||
| 71 | 83 | #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000 | |
| 72 | 84 | PyAPI_FUNC(PyObject *) PyObject_GenericGetDict(PyObject *, void *); | |
| 73 | 85 | #endif | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + Add :c:func:`PyDict_SetDefaultRef` to the Stable ABI. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2639,3 +2639,5 @@ | |||
| 2639 | 2639 | added = '3.15' | |
| 2640 | 2640 | [const.Py_mod_token] | |
| 2641 | 2641 | added = '3.15' | |
| 2642 | + [function.PyDict_SetDefaultRef] | ||
| 2643 | + added = '3.15' | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments