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:
@@ -18,7 +18,7 @@ STATIC void none_print(void (*print)(void *env, const char *fmt, ...), void *env
|
||||
STATIC mp_obj_t none_unary_op(int op, mp_obj_t o_in) {
|
||||
switch (op) {
|
||||
case MP_UNARY_OP_BOOL: return mp_const_false;
|
||||
default: return MP_OBJ_NULL; // op not supported for None
|
||||
default: return MP_OBJ_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user