Repository navigation
Comparing changes
Open a pull request
base repository: stefankoegl/python-json-patch
base: v1.40
head repository: stefankoegl/python-json-patch
compare: v1.41
- 7 commits
- 9 files changed
- 2 contributors
Commits on Nov 2, 2026
-
Ship type stubs as a jsonpatch-stubs package (#158)
mypy reported "module is installed, but missing library stubs or py.typed marker" for jsonpatch. PEP 561 has no py.typed marker for single-file modules, so the types are shipped as a stub-only package, jsonpatch-stubs, in the same distribution, which type checkers pick up automatically. This keeps jsonpatch.py a single module without annotations. JSON documents are typed as Any, as they can be any JSON value and the module accepts arbitrary Mapping / Sequence types. Patches are typed as str | bytes | Iterable[Mapping[str, Any]]. A new CI job runs mypy's stubtest to check that the stubs agree with jsonpatch.py, and type-checks typical usage (typetests/usage.py) against the installed distribution with mypy --strict, including usage that must be rejected. Released jsonpointer versions are untyped, so pyproject.toml tells mypy to ignore that; the stubs also pass against the typed jsonpointer from stefankoegl/python-json-pointer#106. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Pewzpj8LrcYUx1DeTxFCMg
Configuration menu - View commit details
-
Copy full SHA for 76e4506 - Browse repository at this point
Copy the full SHA 76e4506View commit details -
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Pewzpj8LrcYUx1DeTxFCMg
Configuration menu - View commit details
-
Copy full SHA for cec2647 - Browse repository at this point
Copy the full SHA cec2647View commit details -
Require jsonpointer 3.8, which ships type stubs
jsonpointer 3.8 includes its own type stubs, so mypy no longer needs to ignore it, and JsonPointer / pointer_cls in the jsonpatch stubs now have real types instead of Any. The usage type test now also covers a custom JsonPointer subclass as pointer_cls, and rejects a pointer_cls that is not one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Pewzpj8LrcYUx1DeTxFCMg
Configuration menu - View commit details
-
Copy full SHA for a839944 - Browse repository at this point
Copy the full SHA a839944View commit details -
Re-export JsonPointer and JsonPointerException in the stubs
jsonpatch.py imports both from jsonpointer, so jsonpatch.JsonPointer and jsonpatch.JsonPointerException work at runtime (ext_tests.py catches the latter). In a .pyi file, imports are private unless re-exported with a same-name alias, so type checkers rejected these uses. stubtest doesn't notice, as it skips names defined in other modules, so the usage type test now covers them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Pewzpj8LrcYUx1DeTxFCMg
Configuration menu - View commit details
-
Copy full SHA for fedf807 - Browse repository at this point
Copy the full SHA fedf807View commit details -
Accept bytearray in JsonPatch.from_string's type
The default loader (json.loads) accepts bytearray, and from_string passes its input on unchanged, so JsonPatch.from_string(bytearray(...)) works at runtime. apply_patch keeps str | bytes: it treats a bytearray as a sequence of operations and fails, so the usage test checks that type checkers reject that. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Pewzpj8LrcYUx1DeTxFCMg
Configuration menu - View commit details
-
Copy full SHA for ac82662 - Browse repository at this point
Copy the full SHA ac82662View commit details -
Merge pull request #249 from stefankoegl/claude/nifty-brahmagupta-n8vroj
Ship type stubs as a jsonpatch-stubs package
Configuration menu - View commit details
-
Copy full SHA for 9e780d5 - Browse repository at this point
Copy the full SHA 9e780d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for a35303d - Browse repository at this point
Copy the full SHA a35303dView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v1.40...v1.41