Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Carl Meyer <carl@oddbird.net>
  • Loading branch information
serhiy-storchaka and carljm committed Jul 8, 2023
1 parent 3fb9775 commit 84632d1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ Object Protocol
.. c:function:: int PyObject_GetOptionalAttr(PyObject *obj, PyObject *attr_name, PyObject **result);
Replacement of :c:func:`PyObject_GetAttr` which doesn't raise
Variant of :c:func:`PyObject_GetAttr` which doesn't raise
:exc:`AttributeError`.
Return ``1`` and set ``*result != NULL`` if an attribute is found.
Return ``0`` and set ``*result == NULL`` if an attribute is not found;
an :exc:`AttributeError` is silenced.
Return ``1`` and set ``*result != NULL`` if the attribute is found.
Return ``0`` and set ``*result == NULL`` if the attribute is not found;
the :exc:`AttributeError` is silenced.
Return ``-1`` and set ``*result == NULL`` if an error other than
:exc:`AttributeError` is raised.
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ New Features
``NULL`` if the referent is no longer live.
(Contributed by Victor Stinner in :gh:`105927`.)

* Add :c:func:`PyObject_GetOptionalAttr` function: replacement of
* Add :c:func:`PyObject_GetOptionalAttr`, a variant of
:c:func:`PyObject_GetAttr` which doesn't raise :exc:`AttributeError`.
It is convenient and faster if the missing attribute should not be treated
as a failure.
Expand Down
8 changes: 4 additions & 4 deletions Include/abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ extern "C" {
int PyObject_GetOptionalAttr(PyObject *obj, PyObject *attr_name, PyObject **result);
Replacement of PyObject_GetAttr() which doesn't raise AttributeError.
Variant of PyObject_GetAttr() which doesn't raise AttributeError.
Return 1 and set *result != NULL if an attribute is found.
Return 0 and set *result == NULL if an attribute is not found;
an AttributeError is silenced.
Return 1 and set *result != NULL if the attribute is found.
Return 0 and set *result == NULL if the attribute is not found;
the AttributeError is silenced.
Return -1 and set *result == NULL if an error other than AttributeError
is raised.
*/
Expand Down

0 comments on commit 84632d1

Please sign in to comment.