Skip to content

Commit 6023b3b

Browse files
[3.13] Document PyObject_SelfIter (GH-127861) (#127898)
Document PyObject_SelfIter (GH-127861) (cherry picked from commit 58942a0) Co-authored-by: Miro Hrončok <[email protected]>
1 parent 740e9ab commit 6023b3b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Doc/c-api/object.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,12 @@ Object Protocol
509509
iterated.
510510
511511
512+
.. c:function:: PyObject* PyObject_SelfIter(PyObject *obj)
513+
514+
This is equivalent to the Python ``__iter__(self): return self`` method.
515+
It is intended for :term:`iterator` types, to be used in the :c:member:`PyTypeObject.tp_iter` slot.
516+
517+
512518
.. c:function:: PyObject* PyObject_GetAIter(PyObject *o)
513519
514520
This is the equivalent to the Python expression ``aiter(o)``. Takes an

Doc/data/refcounts.dat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,6 +1836,9 @@ PyObject_RichCompareBool:PyObject*:o1:0:
18361836
PyObject_RichCompareBool:PyObject*:o2:0:
18371837
PyObject_RichCompareBool:int:opid::
18381838

1839+
PyObject_SelfIter:PyObject*::+1:
1840+
PyObject_SelfIter:PyObject*:obj:0:
1841+
18391842
PyObject_SetAttr:int:::
18401843
PyObject_SetAttr:PyObject*:o:0:
18411844
PyObject_SetAttr:PyObject*:attr_name:0:

0 commit comments

Comments
 (0)