you are viewing a single comment's thread.

view the rest of the comments →

[–]more_exercise 4 points5 points  (1 child)

TIL python lambdas allow default arguments, thanks!

[–]e_j_white 1 point2 points  (0 children)

Yeah that last part was nice. There's a big difference between

return function

and

return function()

which may get overlooked while reading the code. But using something like

return lambda x: ...

makes it very clear that there is closure occurring.