Skip to content

Commit 3d61528

Browse files
committed
py: Add 'builtins' module.
1 parent 612045f commit 3d61528

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

py/builtintables.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,15 @@ const mp_obj_dict_t mp_builtin_object_dict_obj = {
160160
},
161161
};
162162

163+
STATIC const mp_obj_module_t mp_module_builtins = {
164+
.base = { &mp_type_module },
165+
.name = MP_QSTR_builtins,
166+
.globals = (mp_obj_dict_t*)&mp_builtin_object_dict_obj,
167+
};
168+
163169
STATIC const mp_map_elem_t mp_builtin_module_table[] = {
164170
{ MP_OBJ_NEW_QSTR(MP_QSTR___main__), (mp_obj_t)&mp_module___main__ },
171+
{ MP_OBJ_NEW_QSTR(MP_QSTR_builtins), (mp_obj_t)&mp_module_builtins },
165172
{ MP_OBJ_NEW_QSTR(MP_QSTR_micropython), (mp_obj_t)&mp_module_micropython },
166173

167174
#if MICROPY_PY_ARRAY

py/qstrdefs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ Q(align)
8686
Q(data)
8787
#endif
8888

89+
Q(builtins)
90+
8991
Q(Ellipsis)
9092
Q(StopIteration)
9193

0 commit comments

Comments
 (0)