iterobject.pxd 1.0 KB

123456789101112131415161718192021222324
  1. cdef extern from "Python.h":
  2. ###########################################################################
  3. # Iterator Objects
  4. ###########################################################################
  5. bint PySeqIter_Check(object op)
  6. # Return true if the type of op is PySeqIter_Type.
  7. object PySeqIter_New(object seq)
  8. # Return value: New reference.
  9. # Return an iterator that works with a general sequence object, seq. The
  10. # iteration ends when the sequence raises IndexError for the subscripting
  11. # operation.
  12. bint PyCallIter_Check(object op)
  13. # Return true if the type of op is PyCallIter_Type.
  14. object PyCallIter_New(object callable, object sentinel)
  15. # Return value: New reference.
  16. # Return a new iterator. The first parameter, callable, can be any Python
  17. # callable object that can be called with no parameters; each call to it
  18. # should return the next item in the iteration. When callable returns a
  19. # value equal to sentinel, the iteration will be terminated.