Skip to content

PyCell_[G,S]et does not document that they set an exception #121533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sobolevn opened this issue Jul 9, 2024 · 1 comment
Closed

PyCell_[G,S]et does not document that they set an exception #121533

sobolevn opened this issue Jul 9, 2024 · 1 comment
Assignees
Labels
docs Documentation in the Doc dir topic-C-API

Comments

@sobolevn
Copy link
Member

sobolevn commented Jul 9, 2024

.. c:function:: int PyCell_Set(PyObject *cell, PyObject *value)
Set the contents of the cell object *cell* to *value*. This releases the
reference to any current content of the cell. *value* may be ``NULL``. *cell*
must be non-``NULL``; if it is not a cell object, ``-1`` will be returned. On
success, ``0`` will be returned.

We should add "returns -1 with an exception set".

Linked PRs

@sobolevn sobolevn added docs Documentation in the Doc dir topic-C-API labels Jul 9, 2024
@sobolevn sobolevn self-assigned this Jul 9, 2024
@sobolevn sobolevn changed the title PyCell_Set does not document that it sets an exception PyCell_[G,S]et does not document that they set an exception Jul 9, 2024
@sobolevn
Copy link
Member Author

sobolevn commented Jul 9, 2024

the same is for PyCell_Get: they both call PyErr_BadInternalCall():

if (!PyCell_Check(op)) {
PyErr_BadInternalCall();
return -1;
}

sobolevn added a commit to sobolevn/cpython that referenced this issue Jul 9, 2024
sobolevn added a commit that referenced this issue Jul 9, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 9, 2024
…ons (pythonGH-121534)

(cherry picked from commit 649d5b6)

Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 9, 2024
…ons (pythonGH-121534)

(cherry picked from commit 649d5b6)

Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
sobolevn added a commit that referenced this issue Jul 9, 2024
…ions (GH-121534) (#121540)

gh-121533: Improve `PyCell_[Get,Set]` docs: mention the exceptions (GH-121534)
(cherry picked from commit 649d5b6)

Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
sobolevn added a commit that referenced this issue Jul 9, 2024
…ions (GH-121534) (#121539)

gh-121533: Improve `PyCell_[Get,Set]` docs: mention the exceptions (GH-121534)
(cherry picked from commit 649d5b6)

Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
@Eclips4 Eclips4 closed this as completed Jul 9, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir topic-C-API
Projects
None yet
Development

No branches or pull requests

2 participants