diff options
author | Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com> | 2020-01-29 11:20:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-29 11:20:53 (GMT) |
commit | e1e80002e28e1055f399a20918c49d50d093709e (patch) | |
tree | 67dbe51a2c6e242f1e68019a611257fe88c2e02e /Doc/c-api/mapping.rst | |
parent | d07d9f4c43bc85a77021bcc7d77643f8ebb605cf (diff) | |
download | cpython-e1e80002e28e1055f399a20918c49d50d093709e.zip cpython-e1e80002e28e1055f399a20918c49d50d093709e.tar.gz cpython-e1e80002e28e1055f399a20918c49d50d093709e.tar.bz2 |
bpo-39153: Clarify C API *SetItem refcounting semantics (GH-18220)
Some of the *SetItem methods in the C API steal a reference to the
given value. This annotates the better behaved ones to assure the
reader that these are not the ones with the inconsistent behaviour.
* 📜🤖 Added by blurb_it.
* make docs consistent with signature
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Doc/c-api/mapping.rst')
-rw-r--r-- | Doc/c-api/mapping.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/c-api/mapping.rst b/Doc/c-api/mapping.rst index 6a80b03..682160d 100644 --- a/Doc/c-api/mapping.rst +++ b/Doc/c-api/mapping.rst @@ -37,7 +37,8 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and Map the string *key* to the value *v* in object *o*. Returns ``-1`` on failure. This is the equivalent of the Python statement ``o[key] = v``. - See also :c:func:`PyObject_SetItem`. + See also :c:func:`PyObject_SetItem`. This function *does not* steal a + reference to *v*. .. c:function:: int PyMapping_DelItem(PyObject *o, PyObject *key) |