Skip to content

Commit 245ccab

Browse files
committed
Backwards compatibility for Derivative
1 parent 7cb51d3 commit 245ccab

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

symengine/lib/symengine_wrapper.pyx

+7-3
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,7 @@ class Max(Function):
16441644

16451645
func = __class__
16461646

1647+
16471648
class Min(Function):
16481649

16491650
def __new__(cls, *args):
@@ -1661,8 +1662,14 @@ class Min(Function):
16611662

16621663
func = __class__
16631664

1665+
16641666
class Derivative(Basic):
16651667

1668+
def __new__(self, expr, *variables):
1669+
if len(variables) == 1 and is_sequence(variables[0]):
1670+
return diff(expr, *variables[0])
1671+
return diff(expr, *variables)
1672+
16661673
@property
16671674
def is_Derivative(self):
16681675
return True
@@ -1676,9 +1683,6 @@ class Derivative(Basic):
16761683
def variables(self):
16771684
return self.args[1:]
16781685

1679-
def __new__(self, expr, *variables):
1680-
return diff(expr, *variables)
1681-
16821686
def _sympy_(Basic self):
16831687
cdef RCP[const symengine.Derivative] X = \
16841688
symengine.rcp_static_cast_Derivative(self.thisptr)

0 commit comments

Comments
 (0)