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:
@@ -25,7 +25,7 @@ STATIC mp_obj_t range_it_iternext(mp_obj_t o_in) {
|
||||
o->cur += o->step;
|
||||
return o_out;
|
||||
} else {
|
||||
return MP_OBJ_NULL;
|
||||
return MP_OBJ_STOP_ITERATION;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user