py: Add 'builtins' module.

This commit is contained in:
Damien George 2014-09-17 23:17:26 +01:00
parent 612045f53f
commit 3d61528fe7
2 changed files with 9 additions and 0 deletions

View File

@ -160,8 +160,15 @@ const mp_obj_dict_t mp_builtin_object_dict_obj = {
},
};
STATIC const mp_obj_module_t mp_module_builtins = {
.base = { &mp_type_module },
.name = MP_QSTR_builtins,
.globals = (mp_obj_dict_t*)&mp_builtin_object_dict_obj,
};
STATIC const mp_map_elem_t mp_builtin_module_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___main__), (mp_obj_t)&mp_module___main__ },
{ MP_OBJ_NEW_QSTR(MP_QSTR_builtins), (mp_obj_t)&mp_module_builtins },
{ MP_OBJ_NEW_QSTR(MP_QSTR_micropython), (mp_obj_t)&mp_module_micropython },
#if MICROPY_PY_ARRAY

View File

@ -86,6 +86,8 @@ Q(align)
Q(data)
#endif
Q(builtins)
Q(Ellipsis)
Q(StopIteration)