Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stefankoegl/python-json-patch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.43
Choose a base ref
...
head repository: stefankoegl/python-json-patch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.44
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Nov 6, 2026

  1. Return concrete types in type stubs

    The typing best practices recommend accepting protocols and abstract
    types as arguments but returning concrete types [1]. This lets callers
    use the capabilities of the returned objects without unnecessary
    conversions. For example, callers can modify generated operations:
    
      patch = jsonpatch.make_patch(original, updated)
      for operation in patch:
          operation["path"] = "/prefix" + operation["path"]
    
    Currently, type checkers reject this assignment because operations were
    exposed as Mapping objects, even though generated operations are
    actually mutable dictionaries.
    
    Expose concrete lists and dictionaries in the stubs while continuing to
    accept abstract iterables and mappings as inputs. Normalize abstract
    inputs where necessary so the runtime behavior matches these guarantees.
    Keep the operation registry read-only and describe its concrete
    MappingProxyType in the stubs.
    
    [1] https://typing.python.org/en/latest/reference/best_practices.html#arguments-and-return-types
    
    Signed-off-by: Stephen Finucane <[email protected]>
    Assisted-by: OpenAI gpt-6.1-sol (via pi)
    stephenfin committed Nov 6, 2026
    Configuration menu
    Copy the full SHA
    38ccf98 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #255 from stephenfin/typing

    Return concrete types in type stubs
    stefankoegl authored Nov 6, 2026
    Configuration menu
    Copy the full SHA
    fe84f3e View commit details
    Browse the repository at this point in the history
  3. bump version to 1.44

    stefankoegl committed Nov 6, 2026
    Configuration menu
    Copy the full SHA
    907d7d1 View commit details
    Browse the repository at this point in the history
Loading