Skip to content

Commit ded8a6c

Browse files
committed
sympify exprs except matrices
1 parent 018ecee commit ded8a6c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

symengine/lib/symengine_wrapper.pyx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4063,7 +4063,16 @@ def module_cleanup():
40634063
import atexit
40644064
atexit.register(module_cleanup)
40654065

4066+
40664067
def diff(expr, *args):
4068+
if isinstance(expr, MatrixBase):
4069+
# Don't sympify matrices so that mutable matrices
4070+
# return mutable matrices
4071+
return _diff(expr, *args)
4072+
return _diff(sympify(expr, *args))
4073+
4074+
4075+
def _diff(expr, *args):
40674076
cdef Basic prev
40684077
cdef Basic b
40694078
cdef size_t i

0 commit comments

Comments
 (0)