Repository navigation
fix(arrays): avoid recursion limits in XOR helpers - #381
Merged
Merged
Conversation
Keep the upstream terminal uniq_with behavior in both iterative paths, including the final comparator pass after reducing multiple arrays. Preserve the incoming source, type, test, and changelog changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The XOR helpers use one Python stack frame for each additional array, so valid calls with many arrays fail with
RecursionError. I replaced the tail calls with a loop while preserving the existing pairwise comparisons, callback order, iterator consumption and single-array paths.Seven new regression cases fail before the fix and pass afterward. The full suite passes 2,887 tests with 100% statement coverage on Python 3.10, 3.12 and 3.13; local
inv cialso passes package and documentation builds, Ruff, MyPy and the generated chaining-type check on 3.13.