commit | 9e1e8cd6428e875eb29be98124ee3b1ba2bace30 | [log] [tgz] |
---|---|---|
author | xbe <xbe@machine> | Wed Mar 12 22:57:16 2014 -0700 |
committer | xbe <xbe@machine> | Wed Mar 12 22:57:16 2014 -0700 |
tree | be21ee15a324d83b28851395182d925d091b12ef | |
parent | 19438fd30a3184b656221a59062ea32453d0fd16 [diff] [blame] |
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.
diff --git a/py/objtuple.c b/py/objtuple.c index d39b36d..827441f 100644 --- a/py/objtuple.c +++ b/py/objtuple.c
@@ -111,7 +111,7 @@ 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: