commit | 0ebf8534ab56c3958be335f0c4c6f857de41f71d | [log] [tgz] |
---|---|---|
author | xbe <xbe@machine> | Sat Feb 01 19:00:41 2014 -0800 |
committer | xbe <xbe@machine> | Sat Feb 01 19:00:41 2014 -0800 |
tree | f8e3e5b9ae008e1c829dc78507f48932084190cb | |
parent | 9ed5435061cc6ae85cd9d8556d934c0e638ffadd [diff] [blame] |
Implement and add tests for the id() builtin function.
diff --git a/py/builtin.c b/py/builtin.c index 56cb49d..333119b 100644 --- a/py/builtin.c +++ b/py/builtin.c
@@ -364,3 +364,9 @@ } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_bytes_obj, 1, 3, mp_builtin_bytes); + +static mp_obj_t mp_builtin_id(mp_obj_t o_in) { + return mp_obj_new_int_from_uint((machine_uint_t)o_in); +} + +MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin_id_obj, mp_builtin_id);