Repository navigation
Match nested mapping values without reparsing stringified keys - #647
Open
ShahadatTest wants to merge 1 commit into
Open
ShahadatTest wants to merge 1 commit into
ShahadatTest 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.
Describe your changes
benedict.core.match({"a": {"b": 1}}, "a.b")currently returns[None], because generated keypaths are passed to plaindict.get(). Numeric dictionary keys also become strings before lookup:benedict({2: "two"}).match("*")returns[None].Collect each original value alongside its formatted path, then sort and filter those pairs. This keeps literal separator/bracket keys and numeric keys attached to their values, supports nested mappings and list/tuple indexes, and preserves configured separators, path ordering and the
indexesswitch. No public signature changes.Related issue
Newly reproduced; no overlapping open issue or PR found.
Validation
Three new regression methods fail on the original implementation. Full Python 3.12 unittest suite: 994 passed. Ruff lint/format, mypy on the changed module and
git diff --checkpass. The first full run overlapped another suite's downloads and hit a truncated shared XLSM fixture; the serial rerun above passed completely.AI assistance
Prepared and tested with OpenAI Codex (GPT-6). Original user request:
new 14ta koro aro(make 14 more new contributions). Diff inspection was automated; no human review or personal production usage is claimed.