diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-17 18:18:55 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-17 18:18:55 +0100 |
commit | 71d3112f7e34d0bdd70012463cf31871bea57c45 (patch) | |
tree | b3333d9d30e7e9ffe700e13e9f3491cd778d890e /py/builtin.c | |
parent | d553be5982722fc5ee5240fbfb15697849881ced (diff) |
py: Make built-in 'range' a class.
Addresses issue #487.
Diffstat (limited to 'py/builtin.c')
-rw-r--r-- | py/builtin.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/py/builtin.c b/py/builtin.c index 5e2015452..217dcc186 100644 --- a/py/builtin.c +++ b/py/builtin.c @@ -362,17 +362,6 @@ STATIC mp_obj_t mp_builtin_print(uint n_args, const mp_obj_t *args, mp_map_t *kw MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_print_obj, 0, mp_builtin_print); -STATIC mp_obj_t mp_builtin_range(uint n_args, const mp_obj_t *args) { - assert(1 <= n_args && n_args <= 3); - switch (n_args) { - case 1: return mp_obj_new_range(0, mp_obj_get_int(args[0]), 1); - case 2: return mp_obj_new_range(mp_obj_get_int(args[0]), mp_obj_get_int(args[1]), 1); - default: return mp_obj_new_range(mp_obj_get_int(args[0]), mp_obj_get_int(args[1]), mp_obj_get_int(args[2])); - } -} - -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_range_obj, 1, 3, mp_builtin_range); - STATIC mp_obj_t mp_builtin_repr(mp_obj_t o_in) { vstr_t *vstr = vstr_new(); mp_obj_print_helper((void (*)(void *env, const char *fmt, ...))vstr_printf, vstr, o_in, PRINT_REPR); |