Skip to content
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

gh-127954: Document PyObject_DelItemString #127986

Merged
merged 1 commit into from
Jan 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,13 @@ Object Protocol
on failure. This is equivalent to the Python statement ``del o[key]``.


.. c:function:: int PyObject_DelItemString(PyObject *o, const char *key)

This is the same as :c:func:`PyObject_DelItem`, but *key* is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the canonical1 way to write it (git grep -i "similar to" Doc/c-api for inspiration):

Suggested change
This is the same as :c:func:`PyObject_DelItem`, but *key* is
Similar to :c:func:`PyObject_DelItem`, but *key* is

Footnotes

  1. "This is the same as" is sometimes used, but "Similar to [...], but" is a more common, and also more concise.

specified as a :c:expr:`const char*` UTF-8 encoded bytes string,
Eclips4 marked this conversation as resolved.
Show resolved Hide resolved
rather than a :c:expr:`PyObject*`.


.. c:function:: PyObject* PyObject_Dir(PyObject *o)

This is equivalent to the Python expression ``dir(o)``, returning a (possibly
Expand Down
Loading