3 ms·
A python "lambda expression" can effectively only be a one-liner - basically the return line of a function minus "return". That is why people consider them cas
by kaens 18y ago
A python "lambda expression" can effectively only be a one-liner - basically the return line of a function minus "return".
That is why people consider them castrated - in most languages I'm aware of that have a "lambda" statement, it can be read as "create an anonymous function that executes this body of statements". In python it reads as "perform a simple transformation or calculation on or with these arguments", as that's all it's generally good for.