Hacker News new | ask | show | jobs
by sgt 5152 days ago
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>

1 comments

Yes, but unfortunately it can only be a single expression.