Message194301
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. |
|
Date |
User |
Action |
Args |
2013-08-03 20:58:16 | terry.reedy | set | recipients:
+ terry.reedy, akuchling |
2013-08-03 20:58:16 | terry.reedy | set | messageid: <1375563496.73.0.458556999556.issue18648@psf.upfronthosting.co.za> |
2013-08-03 20:58:16 | terry.reedy | link | issue18648 messages |
2013-08-03 20:58:16 | terry.reedy | create | |
|