Skip to content

Commit 4f40093

Browse files
authored
feat(types): add comparison methods to CData type hints (#19)
Adds type hints for comparison operators (`__eq__`, `__ne__`, `__lt__`, `__le__`, `__gt__`, `__ge__`) to the `CData` generic class. This allows static type checkers to correctly validate comparison operations on `CData`-wrapped instances, preventing potential runtime errors and improving the overall developer experience.
1 parent fc0e963 commit 4f40093

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cbridge/types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
from typing_extensions import Self
2020

2121
class CData(_CData, Generic[_T]):
22+
def __lt__(self, other: Any) -> bool: ...
23+
def __le__(self, other: Any) -> bool: ...
24+
def __gt__(self, other: Any) -> bool: ...
25+
def __ge__(self, other: Any) -> bool: ...
2226
def __iadd__(self, other: _T) -> Self: ...
2327
def __isub__(self, other: _T) -> Self: ...
2428
def __imul__(self, other: _T) -> Self: ...

0 commit comments

Comments
 (0)