diff options
Diffstat (limited to 'py/sequence.c')
-rw-r--r-- | py/sequence.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/py/sequence.c b/py/sequence.c index 2c1f6a836c..0a4bb26b31 100644 --- a/py/sequence.c +++ b/py/sequence.c @@ -88,6 +88,12 @@ bool mp_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, machine_u } else if (stop > len) { stop = len; } + + // CPython returns empty sequence in such case, or point for assignment is at start + if (start > stop) { + stop = start; + } + *begin = start; *end = stop; return true; |