fix bug: tuple_slice when start, stop, step are unknown

This commit is contained in:
yiyanzhi_akane 2023-03-08 10:18:41 +08:00
parent c38eb7c236
commit e1c752b7cb
1 changed files with 6 additions and 0 deletions

View File

@ -137,6 +137,12 @@ def _tuple_getitem_by_slice(data, slice_index):
start = slice_getitem(slice_index, "start")
stop = slice_getitem(slice_index, "stop")
step = slice_getitem(slice_index, "step")
if start is None:
start = 0
if step is None:
step = 1
if stop is None:
stop = (2**31-1) if step >= 1 else 0
return sequence_slice(data, start, stop, step)
return _tuple_slice(data, slice_index)