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

have comparisons return bool when both objects are values #611

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ekorman
Copy link
Contributor

@ekorman ekorman commented Jun 11, 2024

Currently, when two Equatable objects (that are not symbolic but have values) are compared, the result is a Boolean object instead of an actual bool. this causes some undesired behavior due to example bool(Boolean(False)) == True. and indeed test_add_prediction and test_create_image_dataset_with_detections were bad tests and actually should have been failing (see their updates)

This PR updates the following methods of Equatable to return bools when both sides have values:

  • __eq__
  • __ne__
  • in_
  • __gt__
  • __ge__
  • __lt__
  • __le__

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.

None yet

2 participants