Skip to content

Comment on Charming Python: Functional programming in Pythonparent

Comments

Yeah, 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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.