From a465114fdd34ba5e92c1246824d74f2750f749a7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 11 Jul 2026 08:02:20 +0000 Subject: [PATCH] Fix ty failure on master from the #50/#51 merge crossover MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #51 added int(key) in Pointer.evaluate before PR #50's typing landed; merged together they leave master's Typecheck job red (key is Hashable, int() wants str-ish). Cast at the conversion site — the retry only runs for parsed string tokens. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_016Mu9vEBwU4fQLi8ZgkgdS2 --- patchdiff/pointer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patchdiff/pointer.py b/patchdiff/pointer.py index 1aeac72..5570f28 100644 --- a/patchdiff/pointer.py +++ b/patchdiff/pointer.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any, Hashable, Iterable +from typing import Any, Hashable, Iterable, cast from .types import Diffable @@ -86,7 +86,7 @@ def evaluate(self, obj: Diffable) -> tuple[Diffable | None, Hashable, Any]: # integers (iapply does the same at the leaf). if not hasattr(parent, "append"): raise - cursor = parent[int(key)] + cursor = parent[int(cast("str", key))] # The leaf may legitimately not exist (add ops on dicts, list # "-" append) so we tolerate lookup failures there — but only # when the parent is itself a container we can write into.