Closed chanicpanic closed 1 week ago
LGTM, but my understanding of this code is limited. What do you think are the chances that this will create duplicate solutions?
I think the chances are low. I would hope that if duplicate solutions could be created, it would have happened for some of the existing tests causing them to fail.
From my (imperfect) understanding of the code, I believe that there cannot be more than two different solution nodes at the end:
Within those two groups, ambiguities are handled as usual and SymbolNode
creation is limited by the node_cache
s.
Thanks!
Fixes #1431.
I realized that that bug helped #1427 work: multiple solutions had different end values and were considered distinct. After fixing the bug, the end values of solutions are the same, and the solutions get deduped being considered equal. However, we know that the solutions have different children and should be considered distinct. For simplicity, I updated
SymbolNode
to use the default identity-based equality. Let me know if you have any other ideas for its__eq__
and__hash__
implementations.