Repository navigation
Typed GenExpr and ExprCons fields
#1281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
4af6690
82daaf8
039f0b5
03aa0a8
1cc476b
9db1102
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -249,7 +249,7 @@ class Conshdlr: | |||||
| @disjoint_base | ||||||
| class Constant(GenExpr): | ||||||
| @property | ||||||
| def number(self) -> SupportsFloat: ... | ||||||
| def number(self) -> float: ... | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
| def __init__(self, number: SupportsFloat) -> None: ... | ||||||
| def __neg__(self, /) -> Constant: ... | ||||||
| def __pow__( # type: ignore[override] | ||||||
|
|
@@ -428,11 +428,14 @@ class Expr(ExprLike): | |||||
|
|
||||||
| @disjoint_base | ||||||
| class ExprCons: | ||||||
| _lhs: float | None | ||||||
| _rhs: float | None | ||||||
| expr: Expr | GenExpr | ||||||
| @property | ||||||
| def expr(self) -> ExprLike: ... | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is causing some false positives in type checked code because
Suggested change
|
||||||
| @property | ||||||
| def _lhs(self) -> float | None: ... | ||||||
| @property | ||||||
| def _rhs(self) -> float | None: ... | ||||||
| def __init__( | ||||||
| self, expr: Expr | GenExpr, lhs: float | None = None, rhs: float | None = None | ||||||
| self, expr: ExprLike, lhs: float | None = None, rhs: float | None = None | ||||||
| ) -> None: ... | ||||||
| def normalize(self) -> None: ... | ||||||
| def __bool__(self) -> bool: ... | ||||||
|
|
@@ -2165,7 +2168,7 @@ class PY_SCIP_STATUS: | |||||
| @disjoint_base | ||||||
| class PowExpr(GenExpr): | ||||||
| @property | ||||||
| def expo(self) -> SupportsFloat: ... | ||||||
| def expo(self) -> float: ... | ||||||
| def __init__(self) -> None: ... | ||||||
| def __neg__(self, /) -> ProdExpr: ... | ||||||
|
|
||||||
|
|
@@ -2197,7 +2200,7 @@ class Pricer: | |||||
| @disjoint_base | ||||||
| class ProdExpr(GenExpr): | ||||||
| @property | ||||||
| def constant(self) -> SupportsFloat: ... | ||||||
| def constant(self) -> float: ... | ||||||
| def __init__(self) -> None: ... | ||||||
| def __neg__(self, /) -> ProdExpr: ... | ||||||
|
|
||||||
|
|
@@ -2397,7 +2400,7 @@ class Statistics: | |||||
| @disjoint_base | ||||||
| class SumExpr(GenExpr): | ||||||
| @property | ||||||
| def constant(self) -> SupportsFloat: ... | ||||||
| def constant(self) -> float: ... | ||||||
| def __init__(self) -> None: ... | ||||||
| def __neg__(self, /) -> ProdExpr: ... | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since ExprCons is fewer than 100 lines, I'd like to refactor all ExprCons-related code in a single PR. But it's okay to do in this PR.