diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-08 17:51:47 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-08 17:51:47 +0100 |
commit | 495d781a36381927bcf0c1d03a055a2e3a3284bf (patch) | |
tree | a0531fb4725c016c235a9d9b7d07c576c518508a /py/objlist.c | |
parent | e753d916c01a8297011d7bb9a16e1947c33fe08d (diff) | |
download | micropython-495d781a36381927bcf0c1d03a055a2e3a3284bf.tar.gz micropython-495d781a36381927bcf0c1d03a055a2e3a3284bf.zip |
py: implement UNPACK_EX byte code (for: a, *b, c = d)
Diffstat (limited to 'py/objlist.c')
-rw-r--r-- | py/objlist.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/py/objlist.c b/py/objlist.c index 620bf2944a..371d1cb26e 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -378,6 +378,13 @@ void mp_obj_list_get(mp_obj_t self_in, uint *len, mp_obj_t **items) { *items = self->items; } +void mp_obj_list_set_len(mp_obj_t self_in, uint len) { + // trust that the caller knows what it's doing + // TODO realloc if len got much smaller than alloc + mp_obj_list_t *self = self_in; + self->len = len; +} + void mp_obj_list_store(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { mp_obj_list_t *self = self_in; uint i = mp_get_index(self->base.type, self->len, index, false); |