From 9e1e8cd6428e875eb29be98124ee3b1ba2bace30 Mon Sep 17 00:00:00 2001 From: xbe Date: Wed, 12 Mar 2014 22:57:16 -0700 Subject: Implement str.count and add tests for it. Also modify mp_get_index to accept: 1. Indices that are or evaluate to a boolean. 2. Slice indices. Add tests for these two cases. --- py/objtuple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/objtuple.c') diff --git a/py/objtuple.c b/py/objtuple.c index d39b36d9f..827441f70 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -111,7 +111,7 @@ mp_obj_t tuple_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) { return res; } #endif - uint index = mp_get_index(o->base.type, o->len, rhs); + uint index = mp_get_index(o->base.type, o->len, rhs, false); return o->items[index]; } case RT_BINARY_OP_ADD: -- cgit v1.2.3