]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Document PyObject_SelfIter (GH-127861) (#127898)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 13 Dec 2024 09:37:28 +0000 (10:37 +0100)
committerGitHub <noreply@github.com>
Fri, 13 Dec 2024 09:37:28 +0000 (15:07 +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 1e822fad13aa5d51d0e27aa2f75a984b0696718b..3f0fd905da509708a2ade7aed9b90617c8f5a9ae 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 e5bb0bf78f7a69594e6ee03ab45e1a857bdebdf5..99f4d59b558eae035f16ce6d92ee1f8c9a7411a9 100644 (file)
@@ -1836,6 +1836,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: