summaryrefslogtreecommitdiff
path: root/py/builtintables.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-08-12 18:33:40 +0100
committerDamien George <damien.p.george@gmail.com>2014-08-12 18:33:40 +0100
commit4c03b3a899d49f0f4f2c54903403aaa9b384c315 (patch)
tree98a086456f0f5ce8a8108522f1e11c64697eda43 /py/builtintables.c
parent69c5fe1df676fe5331d5ba9749d84016703e1a59 (diff)
py: Implement builtin reversed() function.
reversed function now implemented, and works for tuple, list, str, bytes and user objects with __len__ and __getitem__. Renamed mp_builtin_len to mp_obj_len to make it publically available (eg for reversed).
Diffstat (limited to 'py/builtintables.c')
-rw-r--r--py/builtintables.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/builtintables.c b/py/builtintables.c
index ff530b93b..0f0cfcbc7 100644
--- a/py/builtintables.c
+++ b/py/builtintables.c
@@ -66,6 +66,7 @@ STATIC const mp_map_elem_t mp_builtin_object_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_property), (mp_obj_t)&mp_type_property },
#endif
{ MP_OBJ_NEW_QSTR(MP_QSTR_range), (mp_obj_t)&mp_type_range },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_reversed), (mp_obj_t)&mp_type_reversed },
#if MICROPY_PY_BUILTINS_SET
{ MP_OBJ_NEW_QSTR(MP_QSTR_set), (mp_obj_t)&mp_type_set },
#endif