mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
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>
This commit is contained in:
parent
d07d9f4c43
commit
e1e80002e2
4 changed files with 14 additions and 6 deletions
|
@ -331,7 +331,8 @@ Object Protocol
|
|||
|
||||
Map the object *key* to the value *v*. Raise an exception and
|
||||
return ``-1`` on failure; return ``0`` on success. This is the
|
||||
equivalent of the Python statement ``o[key] = v``.
|
||||
equivalent of the Python statement ``o[key] = v``. This function *does
|
||||
not* steal a reference to *v*.
|
||||
|
||||
|
||||
.. c:function:: int PyObject_DelItem(PyObject *o, PyObject *key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue