|
|
|
|
|
by throwaway889900
430 days ago
|
|
Sometimes a lambda is more readable. "lambda x : x if x else 1" is pretty understandable and doesn't need to be it's own separately defined function. I should also note that development style also depends on tools, so if your IDE makes inline functions more readable in it's display, it's fine to use concisely defined lambdas. Readablity is a personal preference thing at some point after all. |
|
I think what you're looking for is "x or 1"