jorisvandenbossche commented on code in PR #262:
URL: https://github.com/apache/arrow-nanoarrow/pull/262#discussion_r1269088588
##########
python/src/nanoarrow/_lib.pyx:
##########
@@ -894,8 +894,11 @@ cdef class ArrayStream:
return array
def __iter__(self):
- while True:
- yield self.get_next()
+ try:
Review Comment:
I was also refreshing my Python knowledge on this, and so it's actually in
the `__next__` method that a StopIteration needs to be raised, not in `__iter__`
So another way to implement this would be:
```
def __iter__(self):
return self
def __next__(self):
return self.get_next()
```
(but the current one works fine as well)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]