3 ms·
It sort of is a pain point because you need to move the code out of wherever the lambda was into its own block elsewhere. Breaks up the flow and is awkward. I'd
by EamonnMR 6y ago
It sort of is a pain point because you need to move the code out of wherever the lambda was into its own block elsewhere. Breaks up the flow and is awkward. I'd love to see some kind of block lambda syntax in Python. The one drawback of whitespace syntax...
- mixmastamyk 6y ago"Whitespace syntax" is not the problem. It is that Guido thinks that the anonymous callback style is harder to read and therefore something to avoid most of the time. I tend to agree.
- VectorLock 6y agoAnd I think a lot of people are starting to realize that "callback spaghetti" might not be the best structure to give your code either.
- EamonnMR 6y agoIt's the problem inasmuch as the way you'd spell an anonymous block is non-obvious considering that it would have to work as an argument to a function or element of a literal and in both of those cases indentation is freeform.
- mixmastamyk 6y agoGiven that lambda won't accept more than one expression even on its own dedicated line, I think the discussion is moot. I could imagine a working syntax as indentation already works properly between parens and brackets.