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.
diff --git a/py/objint.c b/py/objint.c
index 2eabff8..2c71f51 100644
--- a/py/objint.c
+++ b/py/objint.c
@@ -193,7 +193,7 @@
// 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 @@
return mp_binary_op(op, rhs_in, lhs_in);
}
}
- return MP_OBJ_NULL;
+ return MP_OBJ_NOT_SUPPORTED;
}
// this is a classmethod