Having grown up with Python lambdas, maybe I’m blind to their limitations, but I didn’t feel like there was any real argument as to why not make a real function when you need more than a lambda.
Having grown up with Python lambdas, maybe I’m blind to their limitations, but I didn’t feel like there was any real argument as to why not make a real function when you need more than a lambda.
It works okay, but I do wish there was a better way
What's wrong with it?
That's missing a "not", right (probably after "really")?
Computationally, python lambda is fully capable of whatever a regular python function can do, including side-effects, (you can call foo.set_bar()).
The limit is syntactical: a lambda has to be one single expression. So, no assignment statement, no multiple lines, etc.
This means you are either one of the best or one of the worst programmers. People in the middle have bugs in their program and can use a debugger to find them.
>sounds like a tooling issue
The tool, in this case, being the interpreter. Which is exactly the point.
In Python it’s quite common to have to refactor in order to debug.