Ticket #20812: functional.py.patch
File functional.py.patch, 871 bytes (added by , 5 years ago) |
---|
-
sage/calculus/functional.py
old new 32 32 33 33 from calculus import SR 34 34 from sage.symbolic.expression import Expression 35 from sage.misc.derivative import derivative_parse 36 from sage.structure.element import get_coercion_model 35 37 36 38 def simplify(f): 37 39 r""" … … 130 132 return f.derivative(*args, **kwds) 131 133 except AttributeError: 132 134 pass 135 try: 136 elts = [e for e in derivative_parse(args) if e is not None] 137 elts.append(f) 138 cm = get_coercion_model() 139 return cm.common_parent(*elts)(f).derivative(*args, **kwds) 140 except (AttributeError, TypeError): 141 pass 133 142 if not isinstance(f, Expression): 134 143 f = SR(f) 135 144 return f.derivative(*args, **kwds)