mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 12:10:13 +01:00
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:
@@ -44,7 +44,7 @@ STATIC mp_obj_t filter_make_new(const mp_obj_type_t *type, size_t n_args, size_t
|
||||
}
|
||||
|
||||
STATIC mp_obj_t filter_iternext(mp_obj_t self_in) {
|
||||
assert(MP_OBJ_IS_TYPE(self_in, &mp_type_filter));
|
||||
mp_check_self(MP_OBJ_IS_TYPE(self_in, &mp_type_filter));
|
||||
mp_obj_filter_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
mp_obj_t next;
|
||||
while ((next = mp_iternext(self->iter)) != MP_OBJ_STOP_ITERATION) {
|
||||
|
||||
Reference in New Issue
Block a user