[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Why the fuck does Python not have anonymous functions? I've

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 9
Thread images: 1

File: transcendent.gif (3MB, 500x540px) Image search: [Google]
transcendent.gif
3MB, 500x540px
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.
Thread posts: 9
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.