Hacker News new | ask | show | jobs
by Ragib_Zaman 2236 days ago
Not allowing multi-line lambdas is beneficial for code readability. If your lambda needs multiple lines, you should write a function.
1 comments

Chained promises are much easier to read when the steps are inlined as multi-line lambdas rather than having to read the code backwards for every function definition. And as much as i love list comprehensions, map() and filter() with 2-3 line lambdas also make a lot of sense.

Sure, you "should" use asyncio instead of promises but honestly it has its own problems, mostly in that it requires the rest of your legacy code base to also be async.