Why the fuck does Python not have anonymous functions? I've tried asking every forum I've ever been to and the best answer I could get was that it's not very "Pythonic".
What's the problem with a fucking anonymous function and why is it not "Pythonic"?
What's an anonymous function?
python has anon functions and they're called lambdas
2 seconds in google
>>57859294
>single line anonymous functions
wow
>>57859272
To put it briefly and simply, a function without a name.
>>57859371
just use a real function if you want a multiliner... what's the benefit at that point?
>>57859371
They still do, so your OP is wrong. Fuck off m8
>>57859400
Because there's absolutely no reason for me to have to waste time trying to think of an appropriate name for a function whose sole purpose is to be run inside of another function or to pass arguments to a higher-order function.
Shit like this is why I hate OOP, I'd rather read functions with no names than bad names.
>>57859244
Real answer:
Is the way the language is meant to be.
The Zen of Python, aka language design guidelines says:
>Explicit is better than implicit.
Self explanatory
>Simple is better than complex.
Anonymous functions are much harder to debug.
>Sparse is better than dense.
Self explanatory
>Readability counts.
Self explanatory
>There should be one-- and preferably only one --obvious way to do it.
If there is already a general way to define functions, there shouldn't be other one.