-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add multirange support. #452
Conversation
@@ -78,22 +78,31 @@ def is_empty(self) -> bool: | |||
def __bool__(self): | |||
return not self.is_empty() | |||
|
|||
def __eq__(self, other): | |||
if not isinstance(other, Range): | |||
def __eq__(self, other) -> bool: |
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 don't think we should have try to have Range
and MultiRange
able to compare equal.
In particular, if we are going to do that, we need to have __hash__
be equal when the objects are equal, which is not worth dealing with.
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.
Good point about hashes equality. I'll drop the equality between Range and MultiRange.
Add multirange codec. Adjust edgedb.Range and create edgedb.Multirange class as Python represenation of ranges and multiranges.
Co-authored-by: Yury Selivanov <[email protected]>
Add multirange codec. Adjust edgedb.Range and create edgedb.MultiRange class as Python representation of ranges and multiranges.
Changes ======= * Implement support for new type descriptor protocol (by @elprans in 47eec19 for #427) * Sync errors (by @elprans in 3bfb574 for #449) * Don't depend on exact syntax errors in tests (by @msullivan in b3ce0c6 for #451) * Fix an error in string representation of RelativeDuration. (by @vpetrovykh in 667da72 for #453) * Add multirange support. (by @vpetrovykh in 15e280e for #452)
Add multirange codec. Adjust edgedb.Range and create edgedb.MultiRange class as Python representation of ranges and multiranges.
Changes ======= * Implement support for new type descriptor protocol (by @elprans in 47eec19 for #427) * Sync errors (by @elprans in 3bfb574 for #449) * Don't depend on exact syntax errors in tests (by @msullivan in b3ce0c6 for #451) * Fix an error in string representation of RelativeDuration. (by @vpetrovykh in 667da72 for #453) * Add multirange support. (by @vpetrovykh in 15e280e for #452)
Add multirange codec.
Adjust edgedb.Range and create edgedb.Multirange class as Python represenation of ranges and multiranges.