Skip to content

Commit 2d31733

Browse files
[3.12] Document PyObject_SelfIter (GH-127861) (#127899)
Document PyObject_SelfIter (GH-127861) (cherry picked from commit 58942a0) Co-authored-by: Miro Hrončok <[email protected]>
1 parent 793059e commit 2d31733

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
@@ -410,6 +410,12 @@ Object Protocol
410410
iterated.
411411
412412
413+
.. c:function:: PyObject* PyObject_SelfIter(PyObject *obj)
414+
415+
This is equivalent to the Python ``__iter__(self): return self`` method.
416+
It is intended for :term:`iterator` types, to be used in the :c:member:`PyTypeObject.tp_iter` slot.
417+
418+
413419
.. c:function:: PyObject* PyObject_GetAIter(PyObject *o)
414420
415421
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
@@ -1818,6 +1818,9 @@ PyObject_RichCompareBool:PyObject*:o1:0:
18181818
PyObject_RichCompareBool:PyObject*:o2:0:
18191819
PyObject_RichCompareBool:int:opid::
18201820

1821+
PyObject_SelfIter:PyObject*::+1:
1822+
PyObject_SelfIter:PyObject*:obj:0:
1823+
18211824
PyObject_SetAttr:int:::
18221825
PyObject_SetAttr:PyObject*:o:0:
18231826
PyObject_SetAttr:PyObject*:attr_name:0:

0 commit comments

Comments
 (0)