diff options
author | xyb <xieyanbo@gmail.com> | 2014-01-14 21:39:05 +0800 |
---|---|---|
committer | xyb <xieyanbo@gmail.com> | 2014-01-14 21:39:05 +0800 |
commit | c178ea471ee30f32439741181d30d6a89830aabf (patch) | |
tree | bbd572854f1491523ab70f122695f511c3d9c265 /py/objint.c | |
parent | 729e9cce7bd31d3f107a4d6e9498b0fa27119e22 (diff) | |
download | micropython-c178ea471ee30f32439741181d30d6a89830aabf.tar.gz micropython-c178ea471ee30f32439741181d30d6a89830aabf.zip |
Implemented int(str) in UNIX
Diffstat (limited to 'py/objint.c')
-rw-r--r-- | py/objint.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/py/objint.c b/py/objint.c index 9cd5ebae29..58fc37b3bb 100644 --- a/py/objint.c +++ b/py/objint.c @@ -22,8 +22,9 @@ static mp_obj_t int_make_new(mp_obj_t type_in, int n_args, const mp_obj_t *args) // TODO allow string as arg and parse it return MP_OBJ_NEW_SMALL_INT(mp_obj_get_int(args[0])); - //case 2: - // TODO, parse with given base + case 2: + // TODO make args[0] and args[1] correct + return MP_OBJ_NEW_SMALL_INT(mp_obj_get_int_base(args[0], args[1])); default: nlr_jump(mp_obj_new_exception_msg_1_arg(MP_QSTR_TypeError, "int takes at most 2 arguments, %d given", (void*)(machine_int_t)n_args)); |