Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
sgt
· 14y ago · 0 comments
Just enclose the anonymous function with "(" and ")". Then you can use an anonymous function longer than one line.
>>> f = lambda x: (x
* x * x)
>>> f
<function <lambda> at 0x108cf3230>
Comments
[–]
jamiltron
14y ago
Yes, but unfortunately it can only be a single expression.