Repository navigation
Conversation
This branch has not been deployed
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.
Deleting a pure-Python radix node with two children resets its branch bit position to zero. Subsequent searches can no longer reach its right descendant even though the prefix still appears in nodes(), and deleting that descendant raises KeyError.
Turn the deleted prefix into the same glue-node representation used when inserting branches, retaining the original bit position. The regression covers IPv4, a non-byte-aligned prefix, and IPv6 at the root and beneath an ancestor, then checks lookups, retained child data/identity, parent reinsertion and repeated deletion.
Fixes #52. Related to #88, whose loader imports the pure-Python backend; the large external dataset was not run here.
Validation: all six regression cases fail on current main and pass with this patch. Full pytest: Python 3.10 with the native extension 41 pass; Python 3.14 with the native extension 40 pass/one skip; Python 3.12 pure Python 40 pass/one skip. All runs pass the six added subtests. The configured flake8 checks pass. Native extension control builds used local Python 3.10/3.14 headers; the system Python 3.12 headers are unavailable.