diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-26 22:36:43 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-26 22:36:43 +0000 |
commit | f61a072f68c59a7acf560e2ead948fb7658c523d (patch) | |
tree | 52fa9d9bf89cf4af6f826cb07175ddd262491dc8 /py/builtin.c | |
parent | 174bca7b5a08e44934562faf599a86caaf2cfec1 (diff) | |
parent | e9137b94f27594ea1bdeb5fa4eaddffcbb7b9e9a (diff) | |
download | micropython-f61a072f68c59a7acf560e2ead948fb7658c523d.tar.gz micropython-f61a072f68c59a7acf560e2ead948fb7658c523d.zip |
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'py/builtin.c')
-rw-r--r-- | py/builtin.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/py/builtin.c b/py/builtin.c index d980454cce..e8746c55c2 100644 --- a/py/builtin.c +++ b/py/builtin.c @@ -388,3 +388,10 @@ STATIC mp_obj_t mp_builtin_id(mp_obj_t o_in) { } MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin_id_obj, mp_builtin_id); + +STATIC mp_obj_t mp_builtin_getattr(mp_obj_t o_in, mp_obj_t attr) { + assert(MP_OBJ_IS_QSTR(attr)); + return rt_load_attr(o_in, MP_OBJ_QSTR_VALUE(attr)); +} + +MP_DEFINE_CONST_FUN_OBJ_2(mp_builtin_getattr_obj, mp_builtin_getattr); |