py: Get rid of assert() in method argument checking functions.

Checks for number of args removes where guaranteed by function descriptor,
self checking is replaced with mp_check_self(). In few cases, exception
is raised instead of assert.
This commit is contained in:
Paul Sokolovsky
2016-08-12 22:06:47 +03:00
parent 83e0ebabb4
commit c4a8004933
11 changed files with 33 additions and 45 deletions

View File

@@ -49,7 +49,7 @@ STATIC mp_obj_t map_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_
}
STATIC mp_obj_t map_iternext(mp_obj_t self_in) {
assert(MP_OBJ_IS_TYPE(self_in, &mp_type_map));
mp_check_self(MP_OBJ_IS_TYPE(self_in, &mp_type_map));
mp_obj_map_t *self = MP_OBJ_TO_PTR(self_in);
mp_obj_t *nextses = m_new(mp_obj_t, self->n_iters);