4 ms·
I'd love let-like syntax in lambdas, something along the lines of lambda x: f(y) + g(y) for y = expensive_computation(x) In Python 3, `reduce` can be triv
by nine_k 11y ago
I'd love let-like syntax in lambdas, something along the lines of
lambda x: f(y) + g(y) for y = expensive_computation(x)
In Python 3, `reduce` can be trivially imported from `functools`.
- gamegoblin 11y agoThe ugly hack around this would be lambda x: (lambda y: f(y) + g(y))(expensive_computation(x))