Skip to content

Deprecate pairwise() in favour of itertools.pairwise() - #116

Merged
stefankoegl merged 1 commit into
claude/pensive-wright-ioey78from
claude/deprecate-pairwise
Nov 11, 2026
Merged

stefankoegl merged 1 commit into
claude/pensive-wright-ioey78from
claude/deprecate-pairwise

Conversation

@stefankoegl

Copy link
Copy Markdown
Owner

Stacked on #114. Once that merges, retarget this to master.

The library doesn't use jsonpointer.pairwise() itself, and itertools.pairwise() is available on every supported Python (3.10+). Removing it outright would break callers, so it is deprecated instead:

  • pairwise() now wraps itertools.pairwise() and emits a DeprecationWarning.
  • The stub is marked @deprecated, so type checkers flag callers too.
  • The docstring has a .. deprecated:: 3.12 note. This assumes the next release is 3.12; adjust it if not.
  • The doctests moved into a unit test that also checks for the warning.

Verified with python -W error -m unittest, flake8, mypy.stubtest, and the docs build.


Generated by Claude Code

pairwise() is not used by the library itself, and itertools.pairwise()
is available on every supported Python version (3.10+). Keep it as a
thin wrapper that emits a DeprecationWarning, and mark it @deprecated
in the type stubs so type checkers flag callers too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
@stefankoegl
stefankoegl merged commit 0ba465a into claude/pensive-wright-ioey78 Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants