From 01389679d840e4b33fa39368ad2fd77d033d78fd Mon Sep 17 00:00:00 2001 From: hanyuone Date: Wed, 22 Jul 2026 17:59:34 +1000 Subject: [PATCH 1/2] feat: add corresponding init values to AbstractValue --- pysvf/pysvf.pyi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pysvf/pysvf.pyi b/pysvf/pysvf.pyi index dafc5ee..6c9261f 100644 --- a/pysvf/pysvf.pyi +++ b/pysvf/pysvf.pyi @@ -1920,6 +1920,12 @@ class AddressValue: class AbstractValue: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, val: IntervalValue) -> None: ... + @overload + def __init__(self, val: AddressValue) -> None: ... @overload def __init__(self, val: int) -> None: ... @overload From 6f7810981f7e7069452a2a2df88c5309fe3e363a Mon Sep 17 00:00:00 2001 From: hanyuone Date: Wed, 22 Jul 2026 17:59:58 +1000 Subject: [PATCH 2/2] fix: use correct overloads for IntervalValue builtins --- pysvf/pysvf.pyi | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pysvf/pysvf.pyi b/pysvf/pysvf.pyi index 6c9261f..c3227c1 100644 --- a/pysvf/pysvf.pyi +++ b/pysvf/pysvf.pyi @@ -1842,17 +1842,21 @@ class IntervalValue: def __init__(self, lb: int, ub: int) -> None: ... @overload def __init__(self, val: int) -> None: ... - def __eq__(self, other: object) -> bool: ... - def __ne__(self, other: object) -> bool: ... + # `__eq__` and `__ne__`'s type annotations are forced as `bool` for all objects, + # use `type: ignore` so that equality operators in C++ and Python are the same + @overload + def __eq__(self, other: 'IntervalValue') -> 'IntervalValue': ... # type: ignore + @overload + def __ne__(self, other: 'IntervalValue') -> 'IntervalValue': ... # type: ignore def __add__(self, other: 'IntervalValue') -> 'IntervalValue': ... def __sub__(self, other: 'IntervalValue') -> 'IntervalValue': ... def __mul__(self, other: 'IntervalValue') -> 'IntervalValue': ... def __truediv__(self, other: 'IntervalValue') -> 'IntervalValue': ... def __mod__(self, other: 'IntervalValue') -> 'IntervalValue': ... - def __lt__(self, other: 'IntervalValue') -> bool: ... - def __le__(self, other: 'IntervalValue') -> bool: ... - def __gt__(self, other: 'IntervalValue') -> bool: ... - def __ge__(self, other: 'IntervalValue') -> bool: ... + def __lt__(self, other: 'IntervalValue') -> 'IntervalValue': ... + def __le__(self, other: 'IntervalValue') -> 'IntervalValue': ... + def __gt__(self, other: 'IntervalValue') -> 'IntervalValue': ... + def __ge__(self, other: 'IntervalValue') -> 'IntervalValue': ... def __and__(self, other: "IntervalValue") -> "IntervalValue": ... def __or__(self, other: "IntervalValue") -> "IntervalValue": ... def __xor__(self, other: "IntervalValue") -> "IntervalValue": ...