Skip to content

Commit 7dbf944

Browse files
committed
Refine operator type hints in scip.pyi
Replace Incomplete with object for several ExprLike operator stubs (__radd__, __sub__, __rsub__, __rmul__, __rtruediv__, __neg__) to relax/standardize return and operand typing. Also add missing __rtruediv__ stubs to Expr and GenExpr. These changes improve the type stubs for static type checkers and better reflect Python operator semantics.
1 parent d88206c commit 7dbf944

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/pyscipopt/scip.pyi

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,12 @@ class ExprLike:
331331
*args: Incomplete,
332332
**kwargs: Incomplete,
333333
) -> Incomplete: ...
334-
def __radd__(self, other: Incomplete, /) -> Incomplete: ...
335-
def __sub__(self, other: Incomplete, /) -> Incomplete: ...
336-
def __rsub__(self, other: Incomplete, /) -> Incomplete: ...
337-
def __rmul__(self, other: Incomplete, /) -> Incomplete: ...
338-
def __rtruediv__(self, other: Incomplete, /) -> Incomplete: ...
339-
def __neg__(self) -> Incomplete: ...
334+
def __radd__(self, other: object, /) -> object: ...
335+
def __sub__(self, other: object, /) -> object: ...
336+
def __rsub__(self, other: object, /) -> object: ...
337+
def __rmul__(self, other: object, /) -> object: ...
338+
def __rtruediv__(self, other: object, /) -> object: ...
339+
def __neg__(self) -> object: ...
340340
def __abs__(self) -> GenExpr: ...
341341
def exp(self) -> GenExpr: ...
342342
def log(self) -> GenExpr: ...
@@ -364,6 +364,7 @@ class Expr(ExprLike):
364364
def __pow__(self, other: Incomplete, modulo: Incomplete = ..., /) -> Incomplete: ...
365365
def __rpow__(self, other: Incomplete, /) -> Incomplete: ...
366366
def __truediv__(self, other: Incomplete, /) -> Incomplete: ...
367+
def __rtruediv__(self, other: object, /) -> object: ...
367368

368369
@disjoint_base
369370
class ExprCons:
@@ -400,6 +401,7 @@ class GenExpr(ExprLike):
400401
def __pow__(self, other: Incomplete, modulo: Incomplete = ..., /) -> Incomplete: ...
401402
def __rpow__(self, other: Incomplete, /) -> Incomplete: ...
402403
def __truediv__(self, other: Incomplete, /) -> Incomplete: ...
404+
def __rtruediv__(self, other: object, /) -> object: ...
403405

404406
@disjoint_base
405407
class Heur:

0 commit comments

Comments
 (0)