On Tue, 24 Mar 2015 15:33:41 -0400, Terry Reedy <tjre...@udel.edu> wrote:
> >You have discovered one of advantages of a def statement over a >name=lambda assignment statement. In Python, there is no good reason to >use the latter form and PEP 8 specifically discourages it: "Always use a >def statement instead of an assignment statement that binds a lambda >expression directly to an identifier." Chris also suggested me this. And frankly, I don't see why I shouldn't follow that advise. It's good advice. However, lambda functions do read well in my mind and I find it hard to spot where they obscure the code more than a function. So the explicit vs. implicit part of the argument doesn't translate well with me. I however agree that a function declaration brings other benefits, like the ability to decorate or document. I will reserve the use of lambdas to only where they are necessary. Thanks. -- https://mail.python.org/mailman/listinfo/python-list