From 5fd5af98d0292e06f42e0e0dc6ea8278219cdd6e Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 25 May 2014 22:12:56 +0300 Subject: objlist: Implement support for arbitrary (3-arg) slices. --- py/objlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/objlist.c') diff --git a/py/objlist.c b/py/objlist.c index 8643be41a1..647096f0dd 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -178,7 +178,7 @@ STATIC mp_obj_t list_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) { mp_bound_slice_t slice; if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice)) { - assert(0); + return mp_seq_extract_slice(self->len, self->items, &slice); } mp_obj_list_t *res = list_new(slice.stop - slice.start); mp_seq_copy(res->items, self->items + slice.start, res->len, mp_obj_t); -- cgit v1.2.3