Skip to content

Stop nth after reading the requested item - #462

Merged
dgilland merged 2 commits into
dgilland:developfrom
Gambit-Checkmate:fix/nth-stop-at-index
Nov 15, 2026
Merged

dgilland merged 2 commits into
dgilland:developfrom
Gambit-Checkmate:fix/nth-stop-at-index

Conversation

@Gambit-Checkmate

Copy link
Copy Markdown
Contributor

Fixes #461. nth(iterable, n) now stops at a nonnegative index, so callers can keep using the iterator and can look up an item in an unbounded stream. Negative indices still count from the end.

Three regressions fail on develop and pass with the change. The full Python 3.13.13 suite passed (3,327 tests, 100% coverage). Direct/chain smoke checks passed on Python 3.10–3.14, along with the configured mypy, Ruff, docs and package builds.

OpenAI Codex (GPT-6 based) assisted with investigation, implementation, testing and drafting.

@coveralls

coveralls commented Nov 15, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — Gambit-Checkmate:fix/nth-stop-at-index into dgilland:develop

@dgilland
dgilland merged commit 690c872 into dgilland:develop Nov 15, 2026
5 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.

nth exhausts non-sequence iterables after the requested item

3 participants