From c06ea7abf249765bf93595fc42656eed585d7a47 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 21 Mar 2014 10:55:08 +0000 Subject: py: Implement parsing of infinity and nan for floats. --- py/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/runtime.c') diff --git a/py/runtime.c b/py/runtime.c index 9c8ba636c..5604e1a94 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -375,7 +375,7 @@ mp_obj_t rt_load_const_dec(qstr qstr) { DEBUG_OP_printf("load '%s'\n", qstr_str(qstr)); uint len; const byte* data = qstr_data(qstr, &len); - return mp_parse_num_decimal((const char*)data, len); + return mp_parse_num_decimal((const char*)data, len, true); } mp_obj_t rt_load_const_str(qstr qstr) { -- cgit v1.2.3 From 6e48f7fa856e4acaf085dfc8876c4e3772d979c2 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 21 Mar 2014 11:45:46 +0000 Subject: py: Allow 'complex()' to take a string as first argument. --- py/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/runtime.c') diff --git a/py/runtime.c b/py/runtime.c index 5604e1a94..c268fd546 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -375,7 +375,7 @@ mp_obj_t rt_load_const_dec(qstr qstr) { DEBUG_OP_printf("load '%s'\n", qstr_str(qstr)); uint len; const byte* data = qstr_data(qstr, &len); - return mp_parse_num_decimal((const char*)data, len, true); + return mp_parse_num_decimal((const char*)data, len, true, false); } mp_obj_t rt_load_const_str(qstr qstr) { -- cgit v1.2.3 From be020c27a870feff9773c348fa04be8c54873f70 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 21 Mar 2014 11:39:01 +0200 Subject: py: Make 'str' be a proper type, support standard constructor args. --- py/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/runtime.c') diff --git a/py/runtime.c b/py/runtime.c index c268fd546..2ab97ed18 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -102,6 +102,7 @@ STATIC const mp_builtin_elem_t builtin_table[] = { { MP_QSTR_list, (mp_obj_t)&list_type }, { MP_QSTR_map, (mp_obj_t)&map_type }, { MP_QSTR_set, (mp_obj_t)&set_type }, + { MP_QSTR_str, (mp_obj_t)&str_type }, { MP_QSTR_super, (mp_obj_t)&super_type }, { MP_QSTR_tuple, (mp_obj_t)&tuple_type }, { MP_QSTR_type, (mp_obj_t)&mp_type_type }, @@ -137,7 +138,6 @@ STATIC const mp_builtin_elem_t builtin_table[] = { { MP_QSTR_repr, (mp_obj_t)&mp_builtin_repr_obj }, { MP_QSTR_sorted, (mp_obj_t)&mp_builtin_sorted_obj }, { MP_QSTR_sum, (mp_obj_t)&mp_builtin_sum_obj }, - { MP_QSTR_str, (mp_obj_t)&mp_builtin_str_obj }, { MP_QSTR_bytearray, (mp_obj_t)&mp_builtin_bytearray_obj }, // built-in exceptions -- cgit v1.2.3 From 1ecea7c7539e73f105fef25da8a3bde7783da755 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 21 Mar 2014 23:46:59 +0200 Subject: py: Make 'bytes' be a proper type, support standard constructor args. --- py/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/runtime.c') diff --git a/py/runtime.c b/py/runtime.c index 2ab97ed18..4bcb91c54 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -89,6 +89,7 @@ STATIC const mp_builtin_elem_t builtin_table[] = { // built-in types { MP_QSTR_bool, (mp_obj_t)&bool_type }, + { MP_QSTR_bytes, (mp_obj_t)&bytes_type }, #if MICROPY_ENABLE_FLOAT { MP_QSTR_complex, (mp_obj_t)&mp_type_complex }, #endif @@ -115,7 +116,6 @@ STATIC const mp_builtin_elem_t builtin_table[] = { { MP_QSTR_abs, (mp_obj_t)&mp_builtin_abs_obj }, { MP_QSTR_all, (mp_obj_t)&mp_builtin_all_obj }, { MP_QSTR_any, (mp_obj_t)&mp_builtin_any_obj }, - { MP_QSTR_bytes, (mp_obj_t)&mp_builtin_bytes_obj }, { MP_QSTR_callable, (mp_obj_t)&mp_builtin_callable_obj }, { MP_QSTR_chr, (mp_obj_t)&mp_builtin_chr_obj }, { MP_QSTR_dir, (mp_obj_t)&mp_builtin_dir_obj }, -- cgit v1.2.3