Terry J. Reedy added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18472>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to