Skip to content

Calling + Variable will raise an TypeError. #1225

@Zeroto521

Description

@Zeroto521

Describe the bug

Not sure if this is a bug. I can't call + Variable directly.
It behaves differently from +1.

To Reproduce

from pyscipopt import Model

m = Model()
x = m.addVar(name="x", ub=10)
print(+x)
# Traceback (most recent call last):
#   File "/test.py", line 5, in <module>
#     print(+x)
#           ^^
# TypeError: bad operand type for unary +: 'pyscipopt.scip.Variable'

Expected behavior

Calling + Variable should behave like calling Variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions