Repository navigation
Match integer globs against numeric string dictionary keys - #213
Open
rupayon123 wants to merge 1 commit into
Open
rupayon123 wants to merge 1 commit into
rupayon123 wants to merge 1 commit into
Conversation
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.
An integer glob fails to match a numeric string dictionary key, even though
segments.matchdocuments normalizing integers on both sides. For example,dpath.get({'0': 'value'}, [0])raisesKeyError, while the reverse integer-key/string-glob lookup succeeds.Normalize the glob with the existing
int_strhelper beforefnmatchcase. The numeric-index fast path stays unchanged. Added a Hypothesis regression for both mixed-type directions and nonmatches, plus publicget,values,search,setanddeletecoverage that checks an unrelated key survives mutations.Both new tests fail before the change and pass after.
tox -e py312passes all 81 tests, including package build/install and existing negative-list-index coverage. Repository-wide Flake8 and diff checks also pass. Local validation used CPython 3.12.15 on macOS arm64; the other supported Python/OS combinations were not tested locally.Fixes #212.