Skip to content

Commit cc28588

Browse files
committed
Refactor Expr to standard Python class
Changed Expr from a Cython cdef class to a standard Python class for improved compatibility and maintainability. Removed cdef public dict children, as attribute is now managed in Python.
1 parent 0b7ee70 commit cc28588

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/pyscipopt/expr.pxi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ cdef float _evaluate(dict children, SCIP* scip, SCIP_SOL* sol):
5959
return sum([i._evaluate(scip, sol) * j for i, j in children.items() if j != 0])
6060

6161

62-
cdef class Expr:
62+
class Expr:
6363
"""Base class for mathematical expressions."""
6464

65-
cdef public dict children
66-
6765
def __init__(self, children: Optional[dict] = None):
6866
self.children = children or {}
6967

0 commit comments

Comments
 (0)