py: Add MP_OBJ_STOP_ITERATION and make good use of it.
Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL. This helps a lot in debugging and understanding of function API.
This commit is contained in:
@@ -41,9 +41,9 @@ STATIC mp_obj_t map_iternext(mp_obj_t self_in) {
|
||||
|
||||
for (int i = 0; i < self->n_iters; i++) {
|
||||
mp_obj_t next = mp_iternext(self->iters[i]);
|
||||
if (next == MP_OBJ_NULL) {
|
||||
if (next == MP_OBJ_STOP_ITERATION) {
|
||||
m_del(mp_obj_t, nextses, self->n_iters);
|
||||
return MP_OBJ_NULL;
|
||||
return MP_OBJ_STOP_ITERATION;
|
||||
}
|
||||
nextses[i] = next;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user