I am looking for a library that will allow me to manipulate functions with standard operators (*, -, *, / etc.).
Suppose you have a function f(x) = x ** 2 and g(x) = x + 2 . I would like to write f * g and get a new functor that is essential x ** 2 * (x + 2) or f(g) and get (x + 2) ** 2 .
I know that this is not so difficult to implement, you just need to create the Functor class and overload it with __call__ , but I hope there is a third-party library for it.
I am not trying to use this for something heavy just for training. Thanks for the help.
function python
terminus
source share