Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 649d5b6

Browse filesBrowse files
sobolevnvstinner
andauthored
gh-121533: Improve PyCell_[Get,Set] docs: mention the exceptions (#121534)
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 9ba2a46 commit 649d5b6
Copy full SHA for 649d5b6

File tree

Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed

‎Doc/c-api/cell.rst

Copy file name to clipboardExpand all lines: Doc/c-api/cell.rst
+6-3Lines changed: 6 additions & 3 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.