3 ms·
Not allowing multi-line lambdas is beneficial for code readability. If your lambda needs multiple lines, you should write a function.
by Ragib_Zaman 7y ago
Not allowing multi-line lambdas is beneficial for code readability. If your lambda needs multiple lines, you should write a function.
- Too 7y agoChained 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.