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:
@@ -48,8 +48,7 @@ STATIC mp_obj_t bool_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
|
||||
if (MP_BINARY_OP_OR <= op && op <= MP_BINARY_OP_NOT_EQUAL) {
|
||||
return mp_binary_op(op, MP_OBJ_NEW_SMALL_INT((machine_int_t)mp_obj_is_true(lhs_in)), rhs_in);
|
||||
}
|
||||
// operation not supported
|
||||
return MP_OBJ_NULL;
|
||||
return MP_OBJ_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
const mp_obj_type_t mp_type_bool = {
|
||||
|
||||
Reference in New Issue
Block a user