Skip to content

Commit

Permalink
Document PyObject_SelfIter (pythonGH-127861)
Browse files Browse the repository at this point in the history
(cherry picked from commit 58942a0)

Co-authored-by: Miro Hrončok <[email protected]>
  • Loading branch information
hroncok authored and miss-islington committed Dec 13, 2024
1 parent 9081ea4 commit a1470da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ Object Protocol
iterated.
.. c:function:: PyObject* PyObject_SelfIter(PyObject *obj)
This is equivalent to the Python ``__iter__(self): return self`` method.
It is intended for :term:`iterator` types, to be used in the :c:member:`PyTypeObject.tp_iter` slot.
.. c:function:: PyObject* PyObject_GetAIter(PyObject *o)
This is the equivalent to the Python expression ``aiter(o)``. Takes an
Expand Down
3 changes: 3 additions & 0 deletions Doc/data/refcounts.dat
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,9 @@ PyObject_RichCompareBool:PyObject*:o1:0:
PyObject_RichCompareBool:PyObject*:o2:0:
PyObject_RichCompareBool:int:opid::

PyObject_SelfIter:PyObject*::+1:
PyObject_SelfIter:PyObject*:obj:0:

PyObject_SetAttr:int:::
PyObject_SetAttr:PyObject*:o:0:
PyObject_SetAttr:PyObject*:attr_name:0:
Expand Down

0 comments on commit a1470da

Please sign in to comment.