mirror of
https://github.com/python/cpython.git
synced 2026-04-21 19:31:17 +00:00
[3.14] gh-141004: Document built-in iterator types in the C API (GH-141006) (GH-141134)
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.
(cherry picked from commit 1697cb5710)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This commit is contained in:
parent
7168553c00
commit
cd5508d322
1 changed files with 39 additions and 0 deletions
|
|
@ -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
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue