`Dissappeared` exception is never caught
dlesbre opened this issue · 1 comments
dlesbre commented
When using WeakNode
, pop_min_nonempty
can raise a Disappeared
exception. This exception is never caught...
Possible solutions:
- Export the exception and specify document which functions can raise it.
- Get rid of
pop_min_nonempty
and just havepop_minimum
be recursive and return an option type (slight performance loss as the recursive case must now built/destruct options). - Add a try catch to
pop_minimum
, but I feel this would lose the performance benefit of usingpop_min_nonempty
I'm personally in favor of option 2, @mlemerre thoughts ?
mlemerre commented
Good catch. However, if a "Disappeared" situation occured, I think that we should retry finding the minimum from the start, and not juste return None. This is the "compact and retry" comment that I had left. I am not sure that this corresponds to what you mentionned in 2...