Skip to content

Commit 29a6af7

Browse files
committed
fix: widen schema bound signature
1 parent 929962d commit 29a6af7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/phantom/interval.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,14 @@ def parse(cls: type[Derived], instance: object) -> Derived:
164164
)
165165

166166
@classmethod
167-
def _schema_bound(cls, value: float, infinity: float) -> int | float | None:
167+
def _schema_bound(
168+
cls, value: FloatComparable[Any], infinity: float
169+
) -> int | float | None:
168170
"""Convert interval bound to schema-appropriate numeric type."""
169171
if value == infinity:
170172
return None
171173
if isinstance(cls.__bound__, type) and issubclass(cls.__bound__, int):
172-
return int(value)
174+
return int(value) # type: ignore[call-overload, no-any-return]
173175
return float(value)
174176

175177

0 commit comments

Comments
 (0)