Skip to content

Source code of symengine lambdify function? #490

@Zhyrek

Description

@Zhyrek

Hello, I was just wondering if there was a way to dynamically get the source code for a lambdify'd function in symengine? This is one of the last use cases that I need both symengine and sympy for.

E.g.:

import sympy as sp
import symengine as se

x, y = se.symbols("x y")

f = 2*x*y

lambdify_sp = sp.lambdify((x, y), f, "math")
lambdify_se = se.lambdify((x, y), [f])
print("Sympy source")
print(lambdify_sp.__doc__)
print("_________")
print("Symengine source?")
print(lambdify_se.__doc__)
print("_________")
Sympy source
Created with lambdify. Signature:

func(x, y)

Expression:

2*x*y

Source code:

def _lambdifygenerated(x, y):
    return 2*x*y


Imported modules:


_________
Symengine source?
None
_________

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions