I am wondering if there is any way of adding to lambda functions at the function level.
import numpy as np
f = lambda x: np.sin(5*x)+3
g = lambda x: np.cos(3*x)**2+1
x = np.linspace(-3.14,3.14,1000)
h = f+g % is there any way to create this ?
h_of_x = h(x)
This would be very helpful.
h = lambda x: f(x) + h(x)?h = lambda x: f(g(x))?__add__attribute:a.__add__ = lambda self, b: return lambda *x: self(*x) + b(*x). But python doesn't seem to care if functions have an__add__method :-)