Register   Login   About   Study   Enterprise   Share
AI / Internet Technology University (AITU)
Fast Login - available after registration







|

Top Links: >> 80. Technology >> Internet Technology Summit Program >> 9. AI with Python >> 9.1. The Python Tutorial Introduction >> 9.1.1. Python Docs, Lexicon, and Components >> 9.1.1.3. Python Internals
Current Topic: 9.1.1.3.53. Iterator Objects
You have a privilege to create a quiz (QnA) related to this subject and obtain creativity score...

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



Type object for iterator objects returned by PySeqIter_New() and the one-argument form of the iter() built-in function for built-in sequence types.






int
PySeqIter_Check
(op
)



Return true if the type of op is PySeqIter_Type.






PyObject*
PySeqIter_New
(
PyObject
 *seq
)



Return value: New reference.

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





Was it clear so far?

PyTypeObject
PyCallIter_Type



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






int
PyCallIter_Check
(op
)



Return true if the type of op is PyCallIter_Type.






PyObject*
PyCallIter_New
(
PyObject
 *callable,
PyObject
 *sentinel
)



Return value: New reference.

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.








Topic Graph | Check Your Progress | Propose QnA | Have a question or comments for open discussion?

Have a suggestion? - shoot an email
Looking for something special? - Talk to me
Read: IT of the future: AI and Semantic Cloud Architecture | Fixing Education
Do you want to move from theory to practice and become a magician? Learn and work with us at Internet Technology University (ITU) - JavaSchool.com.

Technology that we offer and How this works: English | Spanish | Russian | French

Internet Technology University | JavaSchool.com | Copyrights © Since 1997 | All Rights Reserved
Patents: US10956676, US7032006, US7774751, US7966093, US8051026, US8863234
Including conversational semantic decision support systems (CSDS) and bringing us closer to The message from 2040
Privacy Policy