Expose __import__() function.

This commit is contained in:
Paul Sokolovsky 2014-02-04 00:46:17 +02:00
parent ca4767984b
commit 1d938c9503
4 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,7 @@
mp_obj_t mp_builtin___import__(int n_args, mp_obj_t *args);
MP_DECLARE_CONST_FUN_OBJ(mp_builtin___build_class___obj);
MP_DECLARE_CONST_FUN_OBJ(mp_builtin___import___obj);
MP_DECLARE_CONST_FUN_OBJ(mp_builtin___repl_print___obj);
MP_DECLARE_CONST_FUN_OBJ(mp_builtin_abs_obj);
MP_DECLARE_CONST_FUN_OBJ(mp_builtin_all_obj);

View File

@ -95,3 +95,4 @@ mp_obj_t mp_builtin___import__(int n_args, mp_obj_t *args) {
return module_obj;
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin___import___obj, 1, 5, mp_builtin___import__);

View File

@ -4,6 +4,7 @@
Q(__build_class__)
Q(__class__)
Q(__doc__)
Q(__import__)
Q(__init__)
Q(__locals__)
Q(__main__)

View File

@ -110,6 +110,7 @@ void rt_init(void) {
// built-in core functions
mp_map_add_qstr(&map_builtins, MP_QSTR___build_class__, (mp_obj_t)&mp_builtin___build_class___obj);
mp_map_add_qstr(&map_builtins, MP_QSTR___import__, (mp_obj_t)&mp_builtin___import___obj);
mp_map_add_qstr(&map_builtins, MP_QSTR___repl_print__, (mp_obj_t)&mp_builtin___repl_print___obj);
// built-in types