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

Inconsistency for returned value type of maybe_equals() #23

Closed
arcondello opened this issue Jun 12, 2024 · 1 comment · Fixed by #49
Closed

Inconsistency for returned value type of maybe_equals() #23

arcondello opened this issue Jun 12, 2024 · 1 comment · Fixed by #49
Labels
bug Something isn't working

Comments

@arcondello
Copy link
Member

Originally reported by @JoelPasvolsky

Depending on whether it's tested on another symbol or on itself, maybe_equals() returns Boolean or integer:

>>> model = Model()
>>> i = model.integer(100, lower_bound=0, upper_bound=20)
>>> j = model.integer(3, lower_bound=-10, upper_bound=10)
>>> j.maybe_equals(j)
True
>>> j.maybe_equals(i)
0
@arcondello arcondello added the bug Something isn't working label Jun 12, 2024
@arcondello
Copy link
Member Author

This should always return a number. Specifically 0 if not equal, 1 if possibly equal, and 2 if definitely equal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant