summaryrefslogtreecommitdiff
path: root/py/objstr.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-15 23:10:00 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-15 23:10:00 +0100
commitee01411036f10d78235cc0549bd4a0507cf7bfc6 (patch)
tree569ce2450afac764ae30eb6b0c851cc842b3b8b8 /py/objstr.c
parent897fe0c0d0e29875cfa32939237c9a6255c5d044 (diff)
py: Add len(bytes).
Diffstat (limited to 'py/objstr.c')
-rw-r--r--py/objstr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/objstr.c b/py/objstr.c
index 0edc49909..7de42b6e9 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -1485,7 +1485,8 @@ uint mp_obj_str_get_hash(mp_obj_t self_in) {
}
uint mp_obj_str_get_len(mp_obj_t self_in) {
- if (MP_OBJ_IS_STR(self_in)) {
+ // TODO This has a double check for the type, one in obj.c and one here
+ if (MP_OBJ_IS_STR(self_in) || MP_OBJ_IS_TYPE(self_in, &mp_type_bytes)) {
GET_STR_LEN(self_in, l);
return l;
} else {