diff --git a/py/argcheck.c b/py/argcheck.c
index 5733c77f1d21e117fd6a96ee4c37c9a6792d9bb0..a6c769ee82971152dd05ae05a1ac8e6c4be0b066 100644
--- a/py/argcheck.c
+++ b/py/argcheck.c
@@ -105,10 +105,9 @@ void mp_arg_parse_all(size_t n_pos, const mp_obj_t *pos, mp_map_t *kws, size_t n
             out_vals[i].u_bool = mp_obj_is_true(given_arg);
         } else if ((allowed[i].flags & MP_ARG_KIND_MASK) == MP_ARG_INT) {
             out_vals[i].u_int = mp_obj_get_int(given_arg);
-        } else if ((allowed[i].flags & MP_ARG_KIND_MASK) == MP_ARG_OBJ) {
-            out_vals[i].u_obj = given_arg;
         } else {
-            assert(0);
+            assert((allowed[i].flags & MP_ARG_KIND_MASK) == MP_ARG_OBJ);
+            out_vals[i].u_obj = given_arg;
         }
     }
     if (pos_found < n_pos) {