Comment on Charming Python: Functional programming in PythonparentComments−bobbyi15yIt lets you define functions on the fly and use them, so the only difference from anonymous functions is that you have to pick a name.−kgo15yYeah, I almost wish they didn't use the keyword 'lambda' at all. If you could just write: def foo(x): def lambda(): print x lambda;bar(callback=lambda);baz(42,lambda) def lambda(): print x * x lambda;bar(callback=lambda);baz(42,lambda) It'd stop this silly complaint. I just end up using 'def lambduh'Slightly annoying that you need to define the function on the line before, can't inline it, but not nearly as bad as people make it out to be.
Comments
It lets you define functions on the fly and use them, so the only difference from anonymous functions is that you have to pick a name.
Yeah, I almost wish they didn't use the keyword 'lambda' at all. If you could just write:
It'd stop this silly complaint. I just end up using 'def lambduh'Slightly annoying that you need to define the function on the line before, can't inline it, but not nearly as bad as people make it out to be.