4 Aug
2013
4 Aug
'13
8:14 a.m.
On 02/08/13 06:52, Alexander Belopolsky wrote:
On Thu, Aug 1, 2013 at 4:29 PM, Terry Reedy
wrote: def f(x): return 2*x f = lambda x: 2*x
Am I the only one who finds the second line above much more readable than the first? The def statement is not intended to be written in one line. The readability suffers because the argument is separated from the value expression by return keyword.
You are not the only one. I will continue to write "f = lambda ..." at the interactive interpreter without shame, although I rarely (never?) use it in code. -- Steven