Skip to content

Commit 525f911

Browse files
committed
fix issue #182: range off by one in to_list
1 parent 05badfb commit 525f911

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pcbasic/basic/memory/arrays.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ def _to_list(self, name, index, remaining_dimensions):
308308
return []
309309
elif len(remaining_dimensions) == 1:
310310
return [
311-
self.get(name, index+[i+(self._base or 0)]).to_value()
312-
for i in range(remaining_dimensions[0])
311+
self.get(name, index+[i]).to_value()
312+
for i in range((self._base or 0), remaining_dimensions[0] + 1)
313313
]
314314
else:
315315
return [
316-
self._to_list(name, index+[i+(self._base or 0)], remaining_dimensions[1:])
317-
for i in range(remaining_dimensions[0])
316+
self._to_list(name, index+[i], remaining_dimensions[1:])
317+
for i in range((self._base or 0), remaining_dimensions[0] + 1)
318318
]

0 commit comments

Comments
 (0)