summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiro HronĨok <miro@hroncok.cz>2024-12-13 09:26:22 (GMT)
committerGitHub <noreply@github.com>2024-12-13 09:26:22 (GMT)
commit58942a07df8811afba9c58dc16c1aab244ccf27a (patch)
tree183979dc148d92a6beb58f4027bb2980be5675d6 /Doc
parentba2d2fda93a03a91ac6cdff319fd23ef51848d51 (diff)
downloadcpython-58942a07df8811afba9c58dc16c1aab244ccf27a.zip
cpython-58942a07df8811afba9c58dc16c1aab244ccf27a.tar.gz
cpython-58942a07df8811afba9c58dc16c1aab244ccf27a.tar.bz2
Document PyObject_SelfIter (#127861)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/object.rst6
-rw-r--r--Doc/data/refcounts.dat3
2 files changed, 9 insertions, 0 deletions
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index 1ae3c46..f97ade0 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -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
diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat
index 3f49c88..a043af4 100644
--- a/Doc/data/refcounts.dat
+++ b/Doc/data/refcounts.dat
@@ -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: