https://github.com/python/cpython/commit/1697cb5710f526d38816bb00ca3dcd4434e5e773
commit: 1697cb5710f526d38816bb00ca3dcd4434e5e773
branch: main
author: Peter Bierma <[email protected]>
committer: ZeroIntensity <[email protected]>
date: 2025-11-06T07:29:04-05:00
summary:
gh-141004: Document built-in iterator types in the C API (GH-141006)
Adds documentation for each of the following:
- PyEnum_Type
- PyFilter_Type
- PyMap_Type
- PyReversed_Type
- PyZip_Type
In addition, PyRange_Type and PyRange_Check are also documented.
files:
M Doc/c-api/iterator.rst
diff --git a/Doc/c-api/iterator.rst b/Doc/c-api/iterator.rst
index 4b94970036f543..7eaf72ec55fd77 100644
--- a/Doc/c-api/iterator.rst
+++ b/Doc/c-api/iterator.rst
@@ -52,6 +52,45 @@ sentinel value is returned.
*sentinel*, the iteration will be terminated.
+Range Objects
+^^^^^^^^^^^^^
+
+.. c:var:: PyTypeObject PyRange_Type
+
+ The type object for :class:`range` objects.
+
+
+.. c:function:: int PyRange_Check(PyObject *o)
+
+ Return true if the object *o* is an instance of a :class:`range` object.
+ This function always succeeds.
+
+
+Builtin Iterator Types
+^^^^^^^^^^^^^^^^^^^^^^
+
+These are built-in iteration types that are included in Python's C API, but
+provide no additional functions. They are here for completeness.
+
+
+.. list-table::
+ :widths: auto
+ :header-rows: 1
+
+ * * C type
+ * Python type
+ * * .. c:var:: PyTypeObject PyEnum_Type
+ * :py:class:`enumerate`
+ * * .. c:var:: PyTypeObject PyFilter_Type
+ * :py:class:`filter`
+ * * .. c:var:: PyTypeObject PyMap_Type
+ * :py:class:`map`
+ * * .. c:var:: PyTypeObject PyReversed_Type
+ * :py:class:`reversed`
+ * * .. c:var:: PyTypeObject PyZip_Type
+ * :py:class:`zip`
+
+
Other Iterator Objects
^^^^^^^^^^^^^^^^^^^^^^
_______________________________________________
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]