diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-03-21 23:46:59 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-03-22 00:07:04 +0200 |
commit | 1ecea7c7539e73f105fef25da8a3bde7783da755 (patch) | |
tree | 9d68bba4d27aec7d752501dedea2fb1e56569d54 /py/builtin.c | |
parent | be020c27a870feff9773c348fa04be8c54873f70 (diff) |
py: Make 'bytes' be a proper type, support standard constructor args.
Diffstat (limited to 'py/builtin.c')
-rw-r--r-- | py/builtin.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/py/builtin.c b/py/builtin.c index 11b86111e..93e91072c 100644 --- a/py/builtin.c +++ b/py/builtin.c @@ -375,18 +375,6 @@ STATIC mp_obj_t mp_builtin_sorted(uint n_args, const mp_obj_t *args, mp_map_t *k MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_sorted_obj, 1, mp_builtin_sorted); -// TODO: This should be type, this is just quick CPython compat hack -STATIC mp_obj_t mp_builtin_bytes(uint n_args, const mp_obj_t *args) { - if (!MP_OBJ_IS_QSTR(args[0]) && !MP_OBJ_IS_TYPE(args[0], &str_type)) { - assert(0); - } - // Currently, MicroPython strings are mix between CPython byte and unicode - // strings. So, conversion is null so far. - return args[0]; -} - -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((machine_int_t)o_in); } |