Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve range: refactor, support start as an optional kwarg, clearer docs and error messages #38041
Improve range: refactor, support start as an optional kwarg, clearer docs and error messages #38041
Changes from 10 commits
62e629f
208eaf0
8d5c3ba
a5ef905
50734fd
3796650
cc25cf3
8c327e9
519ef36
87e8faf
7712b4c
083a4f6
1097661
ba32fef
6a0e25e
7500cdd
0c5fc36
307d59b
65898ed
01f6ccc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 as a default start value sounds like a good idea. Should be a separate PR however. I really don t want to delay this one further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use
@eval
in a for loop here? This just seems a bit hard to maintain.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks cool 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could use some comments. I think
@eval
would make it more complicated. There are four options and4^2 == 16
lines. 16 lines with a non-trivial mapping seems pretty manageable to me. We need to make it easier to read, not less.How about something like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks very self-documenting to my eyes with a clear pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is navigable to me, but I need to parse it to find the correct line. I'm happy with how it is though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put some thought into how to write down this dispatch mechanic. I also considered using
@eval
but decided the above table is the most readable and easy to maintain.