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:
@@ -193,7 +193,7 @@ bool mp_obj_int_is_positive(mp_obj_t self_in) {
|
||||
|
||||
// This is called for operations on SMALL_INT that are not handled by mp_unary_op
|
||||
mp_obj_t mp_obj_int_unary_op(int op, mp_obj_t o_in) {
|
||||
return MP_OBJ_NULL;
|
||||
return MP_OBJ_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
// This is called for operations on SMALL_INT that are not handled by mp_binary_op
|
||||
@@ -262,7 +262,7 @@ mp_obj_t mp_obj_int_binary_op_extra_cases(int op, mp_obj_t lhs_in, mp_obj_t rhs_
|
||||
return mp_binary_op(op, rhs_in, lhs_in);
|
||||
}
|
||||
}
|
||||
return MP_OBJ_NULL;
|
||||
return MP_OBJ_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
// this is a classmethod
|
||||
|
||||
Reference in New Issue
Block a user