4 ms·
As written, your comment isn't demonstrating multiline lambdas. You need to prefix each of the code lines with two spaces so you get a code block. Otherwise it'
by Jtsummers 3y ago
As written, your comment isn't demonstrating multiline lambdas. You need to prefix each of the code lines with two spaces so you get a code block. Otherwise it's treating it as a single paragraph and concatenating it all together.
What you currently have:
foo = lambda x: ( z:=x+1, zz:=z*2, zz+7 )[-1]
What you seem to want:
foo = lambda x: (
z:=x+1,
zz:=z*2,
zz+7
)[-1]