Author terry.reedy
Recipients akuchling, terry.reedy
Date 2013-08-03.20:58:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375563496.73.0.458556999556.issue18648@psf.upfronthosting.co.za>
In-reply-to
Content
Functional Programming HowTo, near the end, has a section
Small functions and the lambda expression
http://docs.python.org/3/howto/functional.html#small-functions-and-the-lambda-expression

To illustrate, it starts with
  adder = lambda x, y: x+y
  print_assign = lambda name, value: name + '=' + str(value)
which are now proscribed by PEP 8. "Always use a def statement instead of an assignment statement that binds a lambda expression directly to a name."

The text goes on to give the def equivalents and to discourage lambdas. "Which alternative is preferable? That’s a style question; my usual course is to avoid using lambda." But I think the section should instead start with lambda examples that would be acceptable in the stdlib.
History
Date User Action Args
2013-08-03 20:58:16terry.reedysetrecipients: + terry.reedy, akuchling
2013-08-03 20:58:16terry.reedysetmessageid: <1375563496.73.0.458556999556.issue18648@psf.upfronthosting.co.za>
2013-08-03 20:58:16terry.reedylinkissue18648 messages
2013-08-03 20:58:16terry.reedycreate