Skip to content

Commit a8402de

Browse files
committed
[Fix] auto-resizing: support slices with None
1 parent 0298276 commit a8402de

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mpython/core/wrapped_types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,10 @@ def _resize_for_index(self, index, set_default=True):
245245
step = next_index.step or 1
246246
start = next_index.start
247247
stop = next_index.stop
248-
start = next_shape + start if start < 0 else start
249-
stop = next_shape + stop if stop < 0 else stop
248+
if start is not None:
249+
start = next_shape + start if start < 0 else start
250+
if stop is not None:
251+
stop = next_shape + stop if stop < 0 else stop
250252
if step < 0:
251253
max_index = start
252254
else:

0 commit comments

Comments
 (0)