|
|
|
|
|
by skeledrew
632 days ago
|
|
Actually you can. If you really want a multi-line lambda with your example... ```f = lambda x, y: [
z := x + y,
w := z 2,
z - w + x,
][-1]``` * That version does look strange, as it uses a list in order to get that last calculation. But I often use lambdas to check results in parametrized tests, and they naturally spread to multiple lines without the list hack since they're chains of comparisons. |
|