From 2d2fafcfd839dbf2930904a03559d7e20e938c9c Mon Sep 17 00:00:00 2001 From: Cody Fincher Date: Tue, 17 Nov 2026 21:01:08 +0000 Subject: [PATCH] fix(serializers): accept frozendict operands in lazy type-encoder registry Python 3.15 stubs add frozendict overloads to dict.__or__/__ror__, which made the narrower _LazyTypeEncoders overrides fail mypyc type-checking and broke every py3.15 mypyc wheel build. --- sqlspec/utils/serializers/_json.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sqlspec/utils/serializers/_json.py b/sqlspec/utils/serializers/_json.py index 7e944e3ea..f1f077e6a 100644 --- a/sqlspec/utils/serializers/_json.py +++ b/sqlspec/utils/serializers/_json.py @@ -98,11 +98,11 @@ def __len__(self) -> int: def __ne__(self, other: object) -> bool: return not self == other - def __or__(self, other: "dict[Any, Any]", /) -> "dict[Any, Any]": + def __or__(self, other: Any, /) -> Any: self._ensure_loaded() return super().__or__(other) - def __ror__(self, other: "dict[Any, Any]", /) -> "dict[Any, Any]": + def __ror__(self, other: Any, /) -> Any: self._ensure_loaded() return super().__ror__(other) @@ -114,7 +114,7 @@ def __setitem__(self, key: type, value: "Callable[[Any], Any]") -> None: self._ensure_loaded() super().__setitem__(key, value) - def __ior__(self, other: Any) -> "Self": # type: ignore[misc,override] + def __ior__(self, other: Any) -> "Self": # type: ignore[override] self._ensure_loaded() super().__ior__(other) return self