Closed leeexyz closed 6 years ago
Was thinking about this, but this would probably involve writing a parser of some sorts? What kind of use cases and what kind of syntax do you have in mind?
Here is what i am thinking about, we can keep it as simple as possible just using eval function in python. We always assume that the input is a string of lambda expression.
>>> plus3 = "lambda x: x + 3"
>>> eval(plus3)
<function <lambda> at 0x1013a52f0>
>>> a = list(range(5))
>>> list(map(eval(plus3), a))
[3, 4, 5, 6, 7]
Thank you for your feedback!
To be honest, I would like to avoid using python-code-as-string arguments (and the usage of eval
in particular).
I'm closing this in favor of #5 as I don't really see any concrete plan to implement this.
It would be nice if we can add the lamdba expression support.