This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients barry, ncoghlan, terry.reedy
Date 2013-07-16.22:23:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1374013427.5.0.0507027276305.issue18472@psf.upfronthosting.co.za>
In-reply-to
Content
Is the scope of this issue just what is in the title, the whole PEP, or something in between;-?

For instance, Guido once approved (on pydev) adding an admonition to Programming Recommendations something like the following.

* Use a def statement instead of an assignment with a lambda expression.
Yes:
def f(x): return 2*x
No:
f = lambda s: 2*x
The (only) difference between these is that the name attribute of the resulting function object is specifically 'f' instead of the generic '<lambda>'. This is more useful for tracebacks and string representations in general.

The entry could point out that a separate statement that binds the function to a name negates the two reasons that justify using lambda, but that is probably unnecessary.

This is from a discussion at least 2 years ago, perhaps 3 or more, before I would have been comfortable or perhaps even eligible to push a patch, and no one else picked up on it either.
History
Date User Action Args
2013-07-16 22:23:47terry.reedysetrecipients: + terry.reedy, barry, ncoghlan
2013-07-16 22:23:47terry.reedysetmessageid: <1374013427.5.0.0507027276305.issue18472@psf.upfronthosting.co.za>
2013-07-16 22:23:47terry.reedylinkissue18472 messages
2013-07-16 22:23:47terry.reedycreate