Repository navigation
Clarify the direction of pointer containment checks - #97
Merged
stefankoegl merged 1 commit intoOct 26, 2026
Merged
stefankoegl merged 1 commit into
stefankoegl merged 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The documentation and examples accurately describe the unchanged implementation, with no unresolved issues.
No open issues 🎉
What changed in this PR
This PR clarifies the direction of JSON Pointer containment checks without changing runtime behavior.
Changes:
- Corrects API docstrings to explain that the argument’s parts must be a prefix of the receiver’s parts.
- Adds doctests covering direction, equality, root pointers, and whole-part matching.
- Adds tutorial guidance showing the equivalent
parent in childexpression.
| File | Description |
|---|---|
jsonpointer.py |
Clarifies containment docstrings and adds executable examples. |
doc/tutorial.rst |
Explains pointer-prefix checks and membership direction. |
Review effort: Balanced
Owner
|
Thanks! |
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 containment docstrings say that
selfcontains the given pointer, but the implementation checks whether the argument's parts are a prefix ofself. For example,child.contains(parent)andparent in childreturn true.Clarify this direction in the API docs and tutorial, with executable examples for both directions, equal/root pointers and whole-part matching (
/foo/bis not a prefix of/foo/bar). Runtime behavior is unchanged.Validation on Windows / Python 3.14.7: all 74 tests pass, including the new doctests; Flake8 passes; the Sphinx HTML build passes with warnings treated as errors.
AI-assisted with OpenAI Codex, including editing and verification.