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

no longer ignore errors in method union of DisjointSet #38944

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sage/sets/disjoint_set.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cdef class DisjointSet_of_hashables(DisjointSet_class):
cdef list _int_to_el
cdef dict _el_to_int
cpdef find(self, e)
cpdef void union(self, e, f) noexcept
cpdef void union(self, e, f) except *
cpdef root_to_elements_dict(self)
cpdef element_to_root_dict(self)
cpdef to_digraph(self)
5 changes: 3 additions & 2 deletions src/sage/sets/disjoint_set.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ cdef class DisjointSet_of_hashables(DisjointSet_class):
cdef int r = <int> OP_find(self._nodes, i)
return self._int_to_el[r]

cpdef void union(self, e, f) noexcept:
cpdef void union(self, e, f) except *:
r"""
Combine the set of ``e`` and the set of ``f`` into one.

Expand Down Expand Up @@ -861,8 +861,9 @@ cdef class DisjointSet_of_hashables(DisjointSet_class):
sage: e
{{'a', 'b', 'c', 'e'}, {'d'}}
sage: e.union('a', 2**10)
KeyError: 1024
Traceback (most recent call last):
...
KeyError: 1024
"""
cdef int i = <int> self._el_to_int[e]
cdef int j = <int> self._el_to_int[f]
Expand Down
Loading