diff options
| author | xbe <xbe@machine> | 2014-03-12 22:57:16 -0700 |
|---|---|---|
| committer | xbe <xbe@machine> | 2014-03-12 22:57:16 -0700 |
| commit | 9e1e8cd6428e875eb29be98124ee3b1ba2bace30 (patch) | |
| tree | be21ee15a324d83b28851395182d925d091b12ef /py/obj.h | |
| parent | 19438fd30a3184b656221a59062ea32453d0fd16 (diff) | |
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/obj.h')
| -rw-r--r-- | py/obj.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -267,7 +267,7 @@ void mp_obj_get_complex(mp_obj_t self_in, mp_float_t *real, mp_float_t *imag); #endif //qstr mp_obj_get_qstr(mp_obj_t arg); mp_obj_t *mp_obj_get_array_fixed_n(mp_obj_t o, machine_int_t n); -uint mp_get_index(const mp_obj_type_t *type, machine_uint_t len, mp_obj_t index); +uint mp_get_index(const mp_obj_type_t *type, machine_uint_t len, mp_obj_t index, bool is_slice); mp_obj_t mp_obj_len_maybe(mp_obj_t o_in); /* may return NULL */ // none |
