Skip to content

Replace index and rindex methods with free functions#290

Merged
ktbarrett merged 1 commit into
devfrom
index-free-method
Jun 21, 2026
Merged

Replace index and rindex methods with free functions#290
ktbarrett merged 1 commit into
devfrom
index-free-method

Conversation

@ktbarrett

Copy link
Copy Markdown
Owner

First the name index collide with the static indexing method index<I>(), so this was changed to index_of, and the reverse lookup to rindex_of to match Python's 'r' prefix for reversed operations.

Next I moved these to free functions scope on the RangedSequence concept as it has a generic implementation. We will figure out nicer method-like spellings and performance-based overloads later.

First the name `index` collide with the static indexing method
`index<I>()`, so this was changed to `index_of`, and the reverse lookup
to `rindex_of` to match Python's 'r' prefix for reversed operations.

Next I moved these to free functions scope on the `RangedSequence`
concept as it has a generic implementation. We will figure out nicer
method-like spellings and performance-based overloads later.
@ktbarrett ktbarrett requested a review from ZiaCheemaGit June 20, 2026 23:32
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.05%. Comparing base (e6ca37e) to head (fc8caf2).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #290   +/-   ##
=======================================
  Coverage   92.05%   92.05%           
=======================================
  Files          23       23           
  Lines        1309     1309           
  Branches      316      316           
=======================================
  Hits         1205     1205           
  Misses         43       43           
  Partials       61       61           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ktbarrett ktbarrett merged commit 7a49f1c into dev Jun 21, 2026
15 checks passed
@ktbarrett ktbarrett deleted the index-free-method branch June 21, 2026 03:10
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.

1 participant