3 ms·
We could have sacrilegious Python version that put up all the stuffs lol. Such as multiline lambda :p here: def begin(\*args): return args[-1] begin(
by cttet 5y ago
We could have sacrilegious Python version that put up all the stuffs lol. Such as multiline lambda :p here:
def begin(\*args):
return args[-1]
begin(
func := lambda x, y: begin(
z := int(input()),
x + y + z
),
func(1, 2)
)
- pizza 5y agoThat's awesome! My personal opinion; lambdas in Python are really limited relative to their potential. We should be better able to exploit the contrast between "a lambda is an expression" and "a def function is a statement." It would be cool if they could be modified just like classes, I think - keep the original lambdas, and add something else nice like Haskell's Arrows.