mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.13] gh-141004: Document missing iterator types in the C API (GH-141010) (GH-141047)
gh-141004: Document missing iterator types in the C API (GH-141010)
Add documentation for each of the following:
- PyByteArrayIter_Type
- PyBytesIter_Type
- PyListIter_Type
- PyListRevIter_Type
- PySetIter_Type
- PyTupleIter_Type
- PyRangeIter_Type
- PyLongRangeIter_Type
- PyDictIterKey_Type
- PyDictRevIterKey_Type
- PyDictIterValue_Type
- PyDictRevIterValue_Type
- PyDictIterItem_Type
- PyDictRevIterItem_Type
---------
(cherry picked from commit 35528fccdc)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
parent
64bf92179b
commit
a3756c6ea0
1 changed files with 29 additions and 0 deletions
|
|
@ -50,3 +50,32 @@ sentinel value is returned.
|
|||
callable object that can be called with no parameters; each call to it should
|
||||
return the next item in the iteration. When *callable* returns a value equal to
|
||||
*sentinel*, the iteration will be terminated.
|
||||
|
||||
|
||||
Other Iterator Objects
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. c:var:: PyTypeObject PyByteArrayIter_Type
|
||||
.. c:var:: PyTypeObject PyBytesIter_Type
|
||||
.. c:var:: PyTypeObject PyListIter_Type
|
||||
.. c:var:: PyTypeObject PyListRevIter_Type
|
||||
.. c:var:: PyTypeObject PySetIter_Type
|
||||
.. c:var:: PyTypeObject PyTupleIter_Type
|
||||
.. c:var:: PyTypeObject PyRangeIter_Type
|
||||
.. c:var:: PyTypeObject PyLongRangeIter_Type
|
||||
.. c:var:: PyTypeObject PyDictIterKey_Type
|
||||
.. c:var:: PyTypeObject PyDictRevIterKey_Type
|
||||
.. c:var:: PyTypeObject PyDictIterValue_Type
|
||||
.. c:var:: PyTypeObject PyDictRevIterValue_Type
|
||||
.. c:var:: PyTypeObject PyDictIterItem_Type
|
||||
.. c:var:: PyTypeObject PyDictRevIterItem_Type
|
||||
|
||||
Type objects for iterators of various built-in objects.
|
||||
|
||||
Do not create instances of these directly; prefer calling
|
||||
:c:func:`PyObject_GetIter` instead.
|
||||
|
||||
Note that there is no guarantee that a given built-in type uses a given iterator
|
||||
type. For example, iterating over :class:`range` will use one of two iterator
|
||||
types depending on the size of the range. Other types may start using a
|
||||
similar scheme in the future, without warning.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue