22 ms·
You can actually just use a regular function declaration in the middle of arbitrary Python code if you want. Does that count as a multi-line lambda?
by nrclark 7y ago
You can actually just use a regular function declaration in the middle of arbitrary Python code if you want. Does that count as a multi-line lambda?
- loeg 7y agoNo.
- nrclark 7y agonot trying to shitpost - I'm legit curious. What's the difference between the two? Like in this snippet, are the two resulting functions different from each other in some way that I haven't considered? def parent_function(): output_function_a = lambda x,y: (x + 23) * y def output_function_b(x, y): return (x + 23) * y return output_function_a, output_function_b