hi there,
I'm just wondering how mp lists and dicts are accessed from within C.
Background is that I want to accelerate some software by implementing native modules which is - to my mind - really an intersting thing but sadly not well described..
accessing list dictionary from C
Re: accessing list dictionary from C
They're described by this structure: https://github.com/micropython/micropyt ... .h#L31-L36
So basically a pointer to a contiguous array of mp_obj_t's, one for each element in the list. You can look at objlist.c for some functions which utilize the data structure.
So basically a pointer to a contiguous array of mp_obj_t's, one for each element in the list. You can look at objlist.c for some functions which utilize the data structure.
Re: accessing list dictionary from C
A whole section is devoted to this subject here: https://micropython-usermod.readthedocs ... ds_11.html
Re: accessing list dictionary from C
wow! this is definitely the documentation i've been looking for.