Skip to content
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

Merged
merged 4 commits into from
Jul 25, 2023
Merged

Add multirange support. #452

merged 4 commits into from
Jul 25, 2023

Conversation

vpetrovykh
Copy link
Member

Add multirange codec.

Adjust edgedb.Range and create edgedb.Multirange class as Python represenation of ranges and multiranges.

edgedb/__init__.py Outdated Show resolved Hide resolved
@@ -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:
Copy link
Member

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.

Copy link
Member Author

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.

vpetrovykh and others added 4 commits July 24, 2023 19:36
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]>
@vpetrovykh vpetrovykh merged commit 717cd76 into master Jul 25, 2023
@vpetrovykh vpetrovykh deleted the multirange branch July 25, 2023 03:14
msullivan pushed a commit that referenced this pull request Aug 9, 2023
Add multirange codec.

Adjust edgedb.Range and create edgedb.MultiRange class as Python
representation of ranges and multiranges.
msullivan added a commit that referenced this pull request Aug 9, 2023
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)
msullivan pushed a commit that referenced this pull request Aug 9, 2023
Add multirange codec.

Adjust edgedb.Range and create edgedb.MultiRange class as Python
representation of ranges and multiranges.
msullivan added a commit that referenced this pull request Aug 9, 2023
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)
@aljazerzen aljazerzen mentioned this pull request Feb 23, 2024
This was referenced Aug 2, 2024
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.

3 participants