Skip to content

Support __pos__ magic method for Expr and GenExpr#1227

Open
Zeroto521 wants to merge 9 commits into
scipopt:masterfrom
Zeroto521:issue#1225
Open

Support __pos__ magic method for Expr and GenExpr#1227
Zeroto521 wants to merge 9 commits into
scipopt:masterfrom
Zeroto521:issue#1225

Conversation

@Zeroto521

Copy link
Copy Markdown
Contributor

Fix #1225

Comment thread tests/test_expr.py
def test_pos():
m = Model()
x = m.addVar(name="x")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing a # test Constant, that crashes, because GenExpr.copy() will look for the children, which Constant doesn't have. I suppose the fix is for constants to have their own copy.

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.

Calling + Variable will raise an TypeError.

2 participants