Skip to content

Make select's offset the 0-based position of the first match - #27

Merged
awolverp merged 1 commit into
awolverp:masterfrom
andersk:select-offset
Oct 7, 2026
Merged

awolverp merged 1 commit into
awolverp:masterfrom
andersk:select-offset

Conversation

@andersk

@andersk andersk commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

select() and select_one() documented offset as the number of initial matches to skip, but treated it as the 1-based position of the first match: offset=0 and offset=1 both started at the first match, and offset=2 skipped only one.

Skip offset matches, so that offset is the 0-based position of the first match, as documented. Update the examples in the documentation, which relied on the old behavior.

select() and select_one() documented offset as the number of initial
matches to skip, but treated it as the 1-based position of the first
match: offset=0 and offset=1 both started at the first match, and
offset=2 skipped only one.

Skip offset matches, so that offset is the 0-based position of the
first match, as documented.  Update the examples in the documentation,
which relied on the old behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@awolverp
awolverp merged commit ecc03f2 into awolverp:master Oct 7, 2026
12 checks passed
@andersk
andersk deleted the select-offset branch October 7, 2026 10:26
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