2 ms·
If it's too complicated for a lambda, you shouldn't be using a lambda. Define a separate function if it takes you more than a line or it's harder to reason abou
by jstx1 5y ago
If it's too complicated for a lambda, you shouldn't be using a lambda. Define a separate function if it takes you more than a line or it's harder to reason about.
- lvass 5y agoThe point is it's only complicated in Python. In other languages, like Rust, it's idiomatic.
- agumonkey 5y agoPeople all know lambdas are expressions only, it's not a biggie really. In all honesty you rarely inline complex lambdas with all you mentioned, it would become hard to read or debug.