]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Document PyObject_SelfIter (GH-127861) (#127899)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 13 Dec 2024 09:38:19 +0000 (10:38 +0100)
committerGitHub <noreply@github.com>
Fri, 13 Dec 2024 09:38:19 +0000 (15:08 +0530)
Document PyObject_SelfIter (GH-127861)
(cherry picked from commit 58942a07df8811afba9c58dc16c1aab244ccf27a)

Co-authored-by: Miro HronĨok <miro@hroncok.cz>
Doc/c-api/object.rst
Doc/data/refcounts.dat

index 2109b12bac909064d440ec25fc65f5f81f1a9380..cefd384fd35a1f45d251786df52719e8794477df 100644 (file)
@@ -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
index 28532620ba603d44a9584c66da47d90b45ee9ff3..88d283aa51e998334825993049e76c6d6201f2ea 100644 (file)
@@ -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: