Content-Length: 260457 | pFad | http://github.com/4cecoder/go-python/commit/c52448f318a3b052db8d8d7b71682b040a4307af

1A other: add ability to iterate an iterable · 4cecoder/go-python@c52448f · GitHub
Skip to content

Commit c52448f

Browse files
aliafsharsbinet
authored andcommitted
other: add ability to iterate an iterable
1 parent ac4579f commit c52448f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

otherobjects.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,14 @@ func PySeqIter_Check(op *PyObject) bool {
526526
return int2bool(C._gopy_PySeqIter_Check(topy(op)))
527527
}
528528

529+
// PyObject* PyIter_Next(PyObject *o)
530+
// Return value: New reference.
531+
//
532+
// Return the next value from the iteration o. The object must be an iterator (it is up to the caller to check this). If there are no remaining values, returns NULL with no exception set. If an error occurs while retrieving the item, returns NULL and passes along the exception.
533+
func PyIter_Next(op *PyObject) *PyObject {
534+
return togo(C.PyIter_Next(topy(op)))
535+
}
536+
529537
// PyObject* PySeqIter_New(PyObject *seq)
530538
// Return value: New reference.
531539
// Return an iterator that works with a general sequence object, seq. The iteration ends when the sequence raises IndexError for the subscripting operation.

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/4cecoder/go-python/commit/c52448f318a3b052db8d8d7b71682b040a4307af

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy