-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
DisjointSet ignores errors #38939
Comments
Please clarify why this is a bug. I think raising an error is correct here (since 'f' is not one of the sets). |
The bug is that the error is not raised. Isn't it explicit enough? |
OK, I was confused. (My bad, but github issues usually include both the expected behavior and the actual behavior, and I was confused about both in this case.) If I understand correctly, currently the code prints a message but does not raise an error, but you (like me) think it should raise an error. |
Indeed. The code prints that an error has occurred and been ignored. And I think it should raise an error. |
method |
…intSet` Fixes sagemath#38939. This PR changes the declaration of method `union` from `noexcept` to `except *` to properly raise errors. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#38944 Reported by: David Coudert Reviewer(s): Travis Scrimshaw
…intSet` Fixes sagemath#38939. This PR changes the declaration of method `union` from `noexcept` to `except *` to properly raise errors. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#38944 Reported by: David Coudert Reviewer(s): Travis Scrimshaw
Because
DisjointSet
is a cython class, some care has to be taken with respect to functions that contain python code that could possibly raise an error. For example, the functionunion
does contain python code that could possibly raise an error, but the error is not raisedThe text was updated successfully, but these errors were encountered: