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:
@@ -154,7 +154,7 @@ mp_obj_t mp_stream_unbuffered_iter(mp_obj_t self) {
|
||||
if (sz != 0) {
|
||||
return l_in;
|
||||
}
|
||||
return MP_OBJ_NULL;
|
||||
return MP_OBJ_STOP_ITERATION;
|
||||
}
|
||||
|
||||
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_read_obj, 1, 2, stream_read);
|
||||
|
||||
Reference in New Issue
Block a user