Itérateurs¶
Python provides two general-purpose iterator objects.  The first, a sequence
iterator, works with an arbitrary sequence supporting the __getitem__()
method.  The second works with a callable object and a sentinel value, calling
the callable for each item in the sequence, and ending the iteration when the
sentinel value is returned.
- 
PyTypeObject PySeqIter_Type¶
-  Part of the Stable ABI.Type des itérateurs renvoyés par les fonctions PySeqIter_New()et la forme à un argument de la fonction nativeiter()pour les séquences natives.
- 
int PySeqIter_Check(PyObject *op)¶
- Return true if the type of op is - PySeqIter_Type. This function always succeeds.
- 
PyObject *PySeqIter_New(PyObject *seq)¶
- Valeur de retour : nouvelle référence. Part of the Stable ABI.Renvoie un itérateur sur la séquence seq. L'itération prend fin lorsque la séquence lève IndexErrorlors d'une tentative d'accès.
- 
PyTypeObject PyCallIter_Type¶
-  Part of the Stable ABI.Type de l'itérateur renvoyé par les fonctions PyCallIter_New()etiter()à deux arguments.
- 
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)¶
- Valeur de retour : nouvelle référence. Part of the Stable ABI.Renvoie un nouvel itérateur. Le premier paramètre, callable, peut être n'importe quel objet Python appelable sans aucun paramètre ; chaque appel doit renvoyer l'élément suivant de l'itération. Lorsque callable renvoie une valeur égale à sentinel, l'itération prend fin.