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.

To write a loop which iterates over an iterator, the C code should look
something like this: