summaryrefslogtreecommitdiffstatshomepage
path: root/py/sequence.c
diff options
context:
space:
mode:
authorxbe <xbe@machine>2014-03-12 22:57:16 -0700
committerxbe <xbe@machine>2014-03-12 22:57:16 -0700
commit9e1e8cd6428e875eb29be98124ee3b1ba2bace30 (patch)
treebe21ee15a324d83b28851395182d925d091b12ef /py/sequence.c
parent19438fd30a3184b656221a59062ea32453d0fd16 (diff)
downloadmicropython-9e1e8cd6428e875eb29be98124ee3b1ba2bace30.tar.gz
micropython-9e1e8cd6428e875eb29be98124ee3b1ba2bace30.zip
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.
Diffstat (limited to 'py/sequence.c')
-rw-r--r--py/sequence.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/sequence.c b/py/sequence.c
index d3c3e32854..1723bb416c 100644
--- a/py/sequence.c
+++ b/py/sequence.c
@@ -149,9 +149,9 @@ mp_obj_t mp_seq_index_obj(const mp_obj_t *items, uint len, uint n_args, const mp
uint stop = len;
if (n_args >= 3) {
- start = mp_get_index(type, len, args[2]);
+ start = mp_get_index(type, len, args[2], true);
if (n_args >= 4) {
- stop = mp_get_index(type, len, args[3]);
+ stop = mp_get_index(type, len, args[3], true);
}
}