3 ms·
I don't see how anyone could have a hard time using lambdas... they've been around forever, and most programming languages nowadays have them. A good rule of t
by yodsanklai 8y ago
I don't see how anyone could have a hard time using lambdas... they've been around forever, and most programming languages nowadays have them.
A good rule of thumb is given by the google python coding guidelines [1]:
"Okay to use them for one-liners. If the code inside the lambda function is any longer than 60-80 chars, it's probably better to define it as a regular (nested) function."
[1] https://github.com/google/styleguide/blob/gh-pages/pyguide.md https://github.com/google/styleguide/blob/gh-pages/pyguide.m...