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.