Skip to content

Commit 148d122

Browse files
jeremyherbertdpgeorge
authored andcommitted
py/dynruntime: Add macros to create a new dict and store to dicts.
1 parent 17a0d65 commit 148d122

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

py/dynruntime.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ static inline void *m_realloc_dyn(void *ptr, size_t new_num_bytes) {
111111
#define mp_obj_new_bytearray_by_ref(n, i) (mp_fun_table.obj_new_bytearray_by_ref((n), (i)))
112112
#define mp_obj_new_tuple(n, items) (mp_fun_table.new_tuple((n), (items)))
113113
#define mp_obj_new_list(n, items) (mp_fun_table.new_list((n), (items)))
114+
#define mp_obj_new_dict(n) (mp_fun_table.new_dict((n)))
114115

115116
#define mp_obj_get_type(o) (mp_fun_table.obj_get_type((o)))
116117
#define mp_obj_cast_to_native_base(o, t) (mp_obj_cast_to_native_base_dyn((o), (t)))
@@ -125,6 +126,7 @@ static inline void *m_realloc_dyn(void *ptr, size_t new_num_bytes) {
125126
#define mp_obj_subscr(base, index, val) (mp_fun_table.obj_subscr((base), (index), (val)))
126127
#define mp_obj_get_array(o, len, items) (mp_obj_get_array_dyn((o), (len), (items)))
127128
#define mp_obj_list_append(list, item) (mp_fun_table.list_append((list), (item)))
129+
#define mp_obj_dict_store(dict, key, val) (mp_fun_table.dict_store((dict), (key), (val)))
128130

129131
#define mp_obj_malloc_helper(n, t) (mp_obj_malloc_helper_dyn(n, t))
130132

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy