Skip to content

Fix negative integer row indexing in FSArray - #199

Merged
sebastinas merged 1 commit into
bpython:mainfrom
omrzk:fix/negative-row-indices
Nov 19, 2026
Merged

sebastinas merged 1 commit into
bpython:mainfrom
omrzk:fix/negative-row-indices

Conversation

@omrzk

@omrzk omrzk commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Negative integer row lookups such as array[-1] always raise IndexError: the index normalization subtracts the negative offset from the row count. Add the offset instead, so these lookups return the stored formatted row.

Regression coverage checks every valid positive and negative index, styled-row identity after replacement, slices, and out-of-range lookups for empty, one-row and multi-row arrays. The final tests fail on unchanged upstream and pass with the fix.

Validation: full suite including doctests and terminal tests passes under a Linux PTY on CPython 3.10.22, 3.12.3 and 3.14.10 (111 passed, one skipped, four expected failures each); source/wheel builds pass. Codespell and test formatting pass. Full Black checks retain the same three existing file failures, and mypy retains the same 28 window.py errors on clean upstream and this branch. No native macOS/Windows or interactive bpython test was run.

@sebastinas
sebastinas merged commit 4a67111 into bpython:main Nov 19, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants