https://github.com/python/cpython/commit/2d317332c0b2f0696177bc4b23c55e75751d1718
commit: 2d317332c0b2f0696177bc4b23c55e75751d1718
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2024-12-13T15:08:19+05:30
summary:

[3.12] Document PyObject_SelfIter (GH-127861) (#127899)

Document PyObject_SelfIter (GH-127861)
(cherry picked from commit 58942a07df8811afba9c58dc16c1aab244ccf27a)

Co-authored-by: Miro HronĨok <[email protected]>

files:
M Doc/c-api/object.rst
M Doc/data/refcounts.dat

diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index 2109b12bac9090..cefd384fd35a1f 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -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
diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat
index 28532620ba603d..88d283aa51e998 100644
--- a/Doc/data/refcounts.dat
+++ b/Doc/data/refcounts.dat
@@ -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:

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to