Skip to content

Commit 649d5b6

Browse files
sobolevnvstinner
andauthored
gh-121533: Improve PyCell_[Get,Set] docs: mention the exceptions (#121534)
Co-authored-by: Victor Stinner <[email protected]>
1 parent 9ba2a46 commit 649d5b6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Doc/c-api/cell.rst

+6-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Cell objects are not likely to be useful elsewhere.
3939
4040
.. c:function:: PyObject* PyCell_Get(PyObject *cell)
4141
42-
Return the contents of the cell *cell*.
42+
Return the contents of the cell *cell*, which can be ``NULL``.
43+
If *cell* is not a cell object, returns ``NULL`` with an exception set.
4344
4445
4546
.. c:function:: PyObject* PyCell_GET(PyObject *cell)
@@ -52,8 +53,10 @@ Cell objects are not likely to be useful elsewhere.
5253
5354
Set the contents of the cell object *cell* to *value*. This releases the
5455
reference to any current content of the cell. *value* may be ``NULL``. *cell*
55-
must be non-``NULL``; if it is not a cell object, ``-1`` will be returned. On
56-
success, ``0`` will be returned.
56+
must be non-``NULL``.
57+
58+
On success, return ``0``.
59+
If *cell* is not a cell object, set an exception and return ``-1``.
5760
5861
5962
.. c:function:: void PyCell_SET(PyObject *cell, PyObject *value)

0 commit comments

Comments
 (0)