疊代器（Iterator）物件
**********************

Python 提供了兩種通用的疊代器 (iterator) 物件，第一種是序列疊代器
(sequence iterator)，適用於支援 "__getitem__()" 方法的任意序列，第二種
是與可呼叫 (callable) 物件和哨兵值 (sentinel value) 一起使用，會呼叫序
列中的每個可呼叫物件，當回傳哨兵值時就結束疊代。

PyTypeObject PySeqIter_Type
    * 為 穩定 ABI 的一部分.*

   此型別物件用於由 "PySeqIter_New()" 所回傳的疊代器物件以及用於內建序
   列型別的內建函式 "iter()" 的單引數形式。

int PySeqIter_Check(PyObject *op)

   Return true if the type of *op* is "PySeqIter_Type".  This function
   always succeeds.

PyObject *PySeqIter_New(PyObject *seq)
    *回傳值：新的參照。** 為 穩定 ABI 的一部分.*

   Return an iterator that works with a general sequence object,
   *seq*.  The iteration ends when the sequence raises "IndexError"
   for the subscripting operation.

PyTypeObject PyCallIter_Type
    * 為 穩定 ABI 的一部分.*

   Type object for iterator objects returned by "PyCallIter_New()" and
   the two-argument form of the "iter()" built-in function.

int PyCallIter_Check(PyObject *op)

   Return true if the type of *op* is "PyCallIter_Type".  This
   function always succeeds.

PyObject *PyCallIter_New(PyObject *callable, PyObject *sentinel)
    *回傳值：新的參照。** 為 穩定 ABI 的一部分.*

   Return a new iterator.  The first parameter, *callable*, can be any
   Python 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.


Range 物件
==========

PyTypeObject PyRange_Type
    * 為 穩定 ABI 的一部分.*

   "range" 物件的型別物件。

int PyRange_Check(PyObject *o)

   Return true if the object *o* is an instance of a "range" object.
   This function always succeeds.


內建疊代器型別
==============

These are built-in iteration types that are included in Python's C
API, but provide no additional functions. They are here for
completeness.

+----------------------------------------------------+----------------------------------------------------+
| C 型別                                             | Python 型別                                        |
|====================================================|====================================================|
| PyTypeObject PyEnum_Type  * 為 穩定 ABI 的一部分.* | "enumerate"                                        |
+----------------------------------------------------+----------------------------------------------------+
| PyTypeObject PyFilter_Type  * 為 穩定 ABI 的一部分 | "filter"                                           |
| .*                                                 |                                                    |
+----------------------------------------------------+----------------------------------------------------+
| PyTypeObject PyMap_Type  * 為 穩定 ABI 的一部分.*  | "map"                                              |
+----------------------------------------------------+----------------------------------------------------+
| PyTypeObject PyReversed_Type  * 為 穩定 ABI 的一部 | "reversed"                                         |
| 分.*                                               |                                                    |
+----------------------------------------------------+----------------------------------------------------+
| PyTypeObject PyZip_Type  * 為 穩定 ABI 的一部分.*  | "zip"                                              |
+----------------------------------------------------+----------------------------------------------------+


其他疊代器物件
==============

PyTypeObject PyByteArrayIter_Type
    * 為 穩定 ABI 的一部分.*

PyTypeObject PyBytesIter_Type
    * 為 穩定 ABI 的一部分.*

PyTypeObject PyListIter_Type
    * 為 穩定 ABI 的一部分.*

PyTypeObject PyListRevIter_Type
    * 為 穩定 ABI 的一部分.*

PyTypeObject PySetIter_Type
    * 為 穩定 ABI 的一部分.*

PyTypeObject PyTupleIter_Type
    * 為 穩定 ABI 的一部分.*

PyTypeObject PyRangeIter_Type
    * 為 穩定 ABI 的一部分.*

PyTypeObject PyLongRangeIter_Type
    * 為 穩定 ABI 的一部分.*

PyTypeObject PyDictIterKey_Type
    * 為 穩定 ABI 的一部分.*

PyTypeObject PyDictRevIterKey_Type
    * 為 穩定 ABI 的一部分 自 3.8 版本開始.*

PyTypeObject PyDictIterValue_Type
    * 為 穩定 ABI 的一部分.*

PyTypeObject PyDictRevIterValue_Type
    * 為 穩定 ABI 的一部分 自 3.8 版本開始.*

PyTypeObject PyDictIterItem_Type
    * 為 穩定 ABI 的一部分.*

PyTypeObject PyDictRevIterItem_Type
    * 為 穩定 ABI 的一部分 自 3.8 版本開始.*

PyTypeObject PyODictIter_Type

   各種內建物件的疊代器型別物件。

   Do not create instances of these directly; prefer calling
   "PyObject_GetIter()" instead.

   Note that there is no guarantee that a given built-in type uses a
   given iterator type. For example, iterating over "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.
