_sympy_ conversion for BuiltinFunction and CallableSymbolicExpression objects
Currently we have:
sage: from sympy import sympify
sage: sympify(sin(x))
sin(x)
sage:
sage: sympify(sin)
SymPyDeprecationWarning:
String fallback in sympify has been deprecated since SymPy 1.6. Use
sympify(str(obj)) or sympy.core.sympify.converter or obj._sympy_
instead.
We should fix this by providing functions with a _sympy_
method that implements the same conversion as SympyConverter.composition
.
Also, converting CallableSymbolicExpression
to sympy forgets about the formal arguments:
sage: from sympy import sympify
sage: f(x, y) = x^2 + y^2; f
(x, y) > x^2 + y^2
sage: sympify(f)
x**2 + y**2
We change it to return a SymPy Lambda
instead.
Change History (9)
Description: 
modified (diff)

Description: 
modified (diff)

Summary: 
_sympy_ method for function objects →
_sympy_ conversion for BuiltinFunction and CallableSymbolicExpression objects

Branch: 
→ u/mkoeppe/_sympy__conversion_for_builtinfunction_and_callablesymbolicexpression_objects

Authors: 
→ Matthias Koeppe

Commit: 
→ d9cff76316fec2da8e4f9ae20eabebef5b4eeb4b

Status: 
new →
needs_review

Cc: 
Nils Bruin KarlDieter Crisman added

Cc: 
Emmanuel Charpentier Markus Wageringel added

Reviewers: 
→ Travis Scrimshaw

Status: 
needs_review →
positive_review

Branch: 
u/mkoeppe/_sympy__conversion_for_builtinfunction_and_callablesymbolicexpression_objects →
d9cff76316fec2da8e4f9ae20eabebef5b4eeb4b

Resolution: 
→ fixed

Status: 
positive_review →
closed

New commits:
Function._sympy_, SympyConverter.__call__: New