]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document PyObject_SelfIter (#127861)
authorMiro Hrončok <miro@hroncok.cz>
Fri, 13 Dec 2024 09:26:22 +0000 (10:26 +0100)
committerGitHub <noreply@github.com>
Fri, 13 Dec 2024 09:26:22 +0000 (14:56 +0530)
Doc/c-api/object.rst
Doc/data/refcounts.dat

index 1ae3c46bea46ea3da4c20c177cfb771b8720661c..f97ade01e67850b630de8fd93a22fd1817a5bdf1 100644 (file)
@@ -509,6 +509,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 3f49c88c3cc028137764ab4243e0b76135facbd6..a043af48ba7a050d474ba5cce18ba1e5dd13aa9d 100644 (file)
@@ -1849,6 +1849,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: