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
feat[next]: Add missing UnitRange comparison functions #1363
feat[next]: Add missing UnitRange comparison functions #1363
Changes from 36 commits
faca090
7931cfd
4734c84
e1463d0
f1047dc
9ac0ddd
f8682ed
42805f7
ec0a0d5
ac28ea0
89e05ea
d639ff0
5ad6be5
11872f3
e9893be
7bc0689
d5b15c4
3a9bfd6
4b6633f
b1ddd31
d1a5045
f1f1fae
6ac320f
98f92c4
eb6f38b
97abbac
470caf3
dffcf0e
7fb65b3
7b574e9
e6d92e0
534ba45
a7a7a76
539c9a2
0ace18e
10f9d3c
5b6a02c
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.
The version I proposed appears much easier to comprehend and now that I see that 4 comparisons are needed performance appears to be the same anyway.
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.
with your proposal we have 2 function calls, 6 comparison and an isinstance check (at least), but I agree that it's simpler to understand
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 agree. @havogt's proposal is better for performance reasons, @tehrengruber is better for readability. In this case I think @havogt version is actually better, but both are fine for me.
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.
Just a question: is this actually correct? Shouldn't it be
_Rng = TypeVar("_Rng", UnitRange, FiniteUnitRange)
instead sinceFiniteUnitRange
doesn't inherit fromUnitRange
?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.
maybe