Hacker News new | ask | show | jobs
by andolanra 5651 days ago
I agree wholeheartedly with all of that; in general, actually, I think lambdas in Python should be used sparingly, if at all, and I think Python makes up for any limitations with its other features (e.g. generators, function decorators, list comprehensions, &c.)

The issues with Python's lambdas really come up when you start trying to do things the Haskell-esque way—which is to say, the super-functional category-theory-on-the-brain way—which can be the right solution to certain problems (e.g. monadic parsers) but tends to be difficult to express in a way that's pleasant, non-hacky, and Pythonic. But I am of the personal opinion that Python's design choices make sense and I don't want to rail against it for not being Haskell or Ruby; I just wanted to show how anonymous functions in particular differ from language to language.