4 ms·
The problem is that in functional languages you have a lot of tools build on higher order functions, so you can easily leverage functions as expressions. On the
by brehaut 17y ago
The problem is that in functional languages you have a lot of tools build on higher order functions, so you can easily leverage functions as expressions. On the other hand, its standard practice to use statement forms (if, while, for, try etc) to describe a lot of the processing.
As statements are not allowed in lambdas this means you either are stuck writing a local named function and writing the code in idiomatic python or writing some helper functions to allow you to write code in a functional but non-idiomatic python style.
It comes down to a matter of style.
My personal theory is that once a python programmer discovers the magic of itertools they are about 3 months from looking for a new language that supports the functional style more naturally.