Why does it need to be anonymous if it's multi line? You can just do a local 'def'.
def f(x):
y = foo(x)
z = bar(y)
// ...
return x
some_obj.do_later(t, f, a, b, c)
I would prefer: some_obj.do_later(t, lambda x: {
y = foo(x)
z = bar(y)
// ...
return x
}, a, b, c)
Maybe ( instead of {? I'm not sure that's possible to parse. Regardless, something like this would be good. some_obj.do_later(t, (lambda x:
# (presently only a single non-comment line would be valid)
x
), a, b, c)Good luck fixing that though.
def begin(*args):
return args[-1]
begin(
func := lambda x, y: begin(
z := int(input()),
x + y + z
),
func(1, 2)
)
from `https://news.ycombinator.com/item?id=23346534`