Skip to content

Remove unused var from VarExpr - #1277

Merged
Joao-Dionisio merged 1 commit into
scipopt:masterfrom
Zeroto521:remove-var-expr-field
Oct 19, 2026
Merged

Joao-Dionisio merged 1 commit into
scipopt:masterfrom
Zeroto521:remove-var-expr-field

Conversation

@Zeroto521

Copy link
Copy Markdown
Contributor

VarExpr in src/pyscipopt/expr.pxi declares cdef public var but never assigns it. __init__ only does self.children = [var].

Copilot AI balanced review requested due to automatic review settings October 19, 2026 11:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Joao-Dionisio Joao-Dionisio changed the title DEP: remove var from VarExpr Remove unused var from VarExpr Oct 19, 2026
@Joao-Dionisio
Joao-Dionisio self-requested a review October 19, 2026 12:27
@Joao-Dionisio
Joao-Dionisio merged commit f5a761d into scipopt:master Oct 19, 2026
7 checks passed
@Zeroto521
Zeroto521 deleted the remove-var-expr-field branch October 19, 2026 12:44
Zeroto521 added a commit to Zeroto521/PySCIPOpt that referenced this pull request Oct 20, 2026
Hand-merged conflicts in CHANGELOG.md, expr.pxi, scip.pxd, scip.pyi
(no conflict markers in working tree).

Key changes from upstream f5a761d:
- scipopt#1267: readonly fields on SumExpr/ProdExpr
- scipopt#1256: dual fix
- scipopt#1273: addConsLinear
- scipopt#1277: remove VarExpr.var
- New: stubs/baseline.sh, requirements/types.txt, pylock.types.toml,
  tests/@types/expr.mypy.out, scripts/generate_expr_type_tests.py

M4 core: Variable(ExprLike), ExprLike base with as_expr/expr_view,
__init__ throws NotImplementedError on Variable.

Bug fix: Expr.__add__/__mul__ now delegate to GenExpr when other is
GenExpr, avoiding PyNumber_Add recursion that caused stack overflow
when computing Expr + GenExpr (e.g., 2*x + exp(x)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants