Skip to content

Comments

Preserve infinite step ranges in views#203

Merged
dlfivefifty merged 2 commits intomasterfrom
jishnub/steprangeviews
Dec 2, 2024
Merged

Preserve infinite step ranges in views#203
dlfivefifty merged 2 commits intomasterfrom
jishnub/steprangeviews

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Dec 2, 2024

After this, the following views are all evaluated eagerly as ranges:

julia> r = 1:4:1:4:+∞

julia> view(r, 2:4)
5:4:13

julia> view(r, 2:∞)
5:4:+∞

julia> view(r, 2:2:∞)
5:8:+

The view forwards the arguments to getindex, which parallels the Base implementation.

@codecov
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.99%. Comparing base (4f757e7) to head (446276d).
Report is 10 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #203      +/-   ##
==========================================
+ Coverage   86.14%   88.99%   +2.84%     
==========================================
  Files           6       10       +4     
  Lines         758     1127     +369     
==========================================
+ Hits          653     1003     +350     
- Misses        105      124      +19     

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

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